Calling CryptMsgCalculateEncodedLength causes GetLastError = 183 ERROR_ALREADY_EXISTS
- From: windows platform sdk <jonlowe3d@xxxxxxxxx>
- Date: Wed, 21 Nov 2007 11:13:25 -0800 (PST)
Hi,
All my calls to CryptMsgCalculateEncodedLength and / or CryptMsgUpdate
return LastError 183 ERROR_ALREADY_EXISTS. Does anyone know what
ERROR_ALREADY_EXISTS means in the CAPI Msg context? I have a string
signed with szOID_RSA_SHA1RSA that I was trying to add to a message.
I tried a non-encoded string similar to the following and got the same
183 (GetLastError is 0 prior to the call):
BYTE str[27] = "AAAAAAAAAAAAAAAAAAAAAAAAAA";
if( !CryptAcquireContext(&hCryptProv, NULL, MS_ENHANCED_PROV,
PROV_RSA_FULL, CRYPT_SILENT) )
{
printf("\nCryptAcquireContext GetLastError %ld",
GetLastError());
return FALSE;
}
if( !(msgLen = CryptMsgCalculateEncodedLength(ALL_ENCODING_TYPES, 0
, CMSG_DATA, str, szOID_RSA_SHA1RSA , 27)) )
I've tried many variations and I always get 183. Any suggestions are
greatly appreciated.
Thanks!
.
- Prev by Date: Unable to enumerate all key container on a smart card
- Next by Date: How can i change logon wallpaper during RDP session in Vista
- Previous by thread: Unable to enumerate all key container on a smart card
- Next by thread: How can i change logon wallpaper during RDP session in Vista
- Index(es):