The CAPICOM_ERROR_CODE enumeration type defines error codes that are returned by CAPICOM.
Note Visual Basic Scripting Edition errors return an Err.number value greater than zero. For those errors, Err.Description values provide information about the cause of the error. In addition to Visual Basic Scripting Edition errors, CAPICOM errors return the codes defined by CAPICOM_ERROR_CODE.
An encoding type that is not valid was used.
The following list shows the valid encoding types:
The Certificate object has not been initialized.
Usually, this error code is returned when a Certificate object is instantiated but not associated with a digital certificate. To associate the object with a digital certificate, either assign it to an existing Certificate object or call the Import method.
The Certificate object does not have an associated private key.
This error code is returned when an attempt is made to sign data using the signer's private key, but the Certificate object that is associated with the Signer object cannot be used for the signing operation.
The Chain object has not been initialized.
The Store object has not been initialized.
The OpenMode parameter of the Store.Open method does not contain a valid value of CAPICOM_STORE_OPEN_MODE.
The following list shows the valid values of CAPICOM_STORE_OPEN_MODE:
The following list shows the valid SaveAs values:
Set the Name property.
Set the Value property.
The following list shows the valid attribute names:
For example, if the Name property is set to CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME, the data type must be DATE.
The Signer object has not been initialized.
The signer cannot be found in the SignedData object.
Usually, this does not happen with a SignedData object that was created by CAPICOM; however, if the SignedData object was created by a third-party product, the signer's certificate may not be included in the PKCS #7 structure.
|CAPICOM_E_SIGNER_NO_CHAIN||0x80880252 // v2.0|
An attempt is made to use the signer in a way that is not valid.
The SignedData object has not been initialized.
The SignedData object contains a type that is not valid.
Usually, this happens when an attempt is made to verify an enveloped message with a SignedData object or vice versa.
The SignedData object has not been signed.
The following list shows the valid algorithm values for the Name property:
The following list shows the valid key length values for the KeyLength property:
The EnvelopedData object has not been initialized.
The EnvelopedData object contains a type that is not valid.
Usually, this happens when an attempt is made to verify a signed message with an EnvelopedData object or vice versa.
To add a recipient, call the Recipients.Add method.
The recipient cannot be found in the EnvelopedData object.
Usually, this does not happen with an EnvelopedData object that was created by CAPICOM; however, if the EnvelopedData object was created by a third-party product, the recipient's certificate may not be included in the PKCS #7 structure.
The EncryptedData object has not been initialized.
The EncryptedData object is not a valid type.
Usually, this means the data is corrupted.
The secret of an EncryptedData object has not been initialized.
The PrivateKey object has not been initialized.
|0x80880300 // v2.0|
The PrivateKey object cannot be exported.
|0x80880301 // v2.0|
The EncodedData object has not been initialized.
|0x80880320 // v2.0|
The Extension object has not been initialized.
|0x80880330 // v2.0|
|CAPICOM_E_PROPERTY_NOT_INITIALIZED||0x80880340 // v2.0|
|CAPICOM_E_FIND_INVALID_TYPE||0x80880350 // v2.0|
The specified predefined policy for the find operation is not valid.
|0x80880351 // v2.0|
The SignedCode object has not been initialized.
|0x80880360 // v2.0|
The SignedCode object has not been signed.
|0x80880361 // v2.0|
|CAPICOM_E_CODE_DESCRIPTION_NOT_INITIALIZED||0x80880362 // v2.0|
|CAPICOM_E_CODE_DESCRIPTION_URL_NOT_INITIALIZED||0x80880363 // v2.0|
The URL parameter of the SignedCode.Timestamp method is not valid.
|0x80880364 // v2.0|
The HashedData object does not contain any data.
|0x80880370 // v2.0|
The convert type is not valid.
|0x80880380 // v2.0|
The requested operation is not supported in the current platform.
The operation has been canceled by the user.
This happens when the user is prompted for permission to carry out a certain operation, such as accessing the private key, and the user cancels the operation.
The attempted operation is not allowed.
|0x80880903 // v2.0|
CAPICOM has run out of a resource.
|0x80880904 // v2.0|
An internal error has occurred.
Contact Microsoft Technical Support for assistance.
An unknown error has occurred.
Collect as much information as possible, and contact your vendor.
|CAPICOM 2.0 or later on Windows Server 2003 and Windows XP|