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.
Members
| Member | Description | Value |
|---|---|---|
| CAPICOM_E_ENCODE_INVALID_TYPE | An encoding type that is not valid was used. The following list shows the valid encoding types:<ul><li>CAPICOM_ENCODE_ANY</li><li>CAPICOM_ENCODE_BASE64</li><li>CAPICOM_ENCODE_BINARY</li></ul> | 0x80880100 |
| CAPICOM_E_EKU_INVALID_OID | The <a href="eku-oid.md">OID</a> property of the <a href="eku.md">EKU</a> object cannot be set because the <a href="eku-name.md">Name</a> property is not set to CAPICOM_EKU_OTHER. Set the <a href="eku-name.md">Name</a> property to CAPICOM_EKU_OTHER before setting the <a href="eku-oid.md">OID</a> property. | 0x80880200 |
| CAPICOM_E_EKU_OID_NOT_INITIALIZED | The <a href="eku-oid.md">OID</a> property of the <a href="eku.md">EKU</a> object has not been initialized. Either set the <a href="eku-name.md">Name</a> property to anything other than CAPICOM_EKU_OTHER, or set the Name property to CAPICOM_EKU_OTHER and the <a href="eku-oid.md">OID</a> property to a value. | 0x80880201 |
| CAPICOM_E_CERTIFICATE_NOT_INITIALIZED | The <a href="certificate.md">Certificate</a> object has not been initialized. Usually, this error code is returned when a <a href="certificate.md">Certificate</a> 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 <a href="certificate-import.md">Import</a> method. | 0x80880210 |
| CAPICOM_E_CERTIFICATE_NO_PRIVATE_KEY | The <a href="certificate.md">Certificate</a> 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 <a href="certificate.md">Certificate</a> object that is associated with the <a href="signer.md">Signer</a> object cannot be used for the signing operation. | 0x80880211 |
| CAPICOM_E_CHAIN_NOT_BUILT | The <a href="chain.md">Chain</a> object has not been initialized. To initialize the <a href="chain.md">Chain</a> object, call the <a href="chain-build.md">Build</a> method. | 0x80880220 |
| CAPICOM_E_STORE_NOT_OPENED | The <a href="store.md">Store</a> object has not been initialized. To initialize the <a href="store.md">Store</a> object, call the <a href="store-open.md">Open</a> method. | 0x80880230 |
| CAPICOM_E_STORE_EMPTY | The <a href="store.md">Store</a> object does not contain any <a href="certificate.md">Certificate</a> objects. | 0x80880231 |
| CAPICOM_E_STORE_INVALID_OPEN_MODE | The OpenMode parameter of the <a href="store-open.md">Store.Open</a> method does not contain a valid value of CAPICOM_STORE_OPEN_MODE. The following list shows the valid values of CAPICOM_STORE_OPEN_MODE:<ul><li>CAPICOM_STORE_OPEN_READ_ONLY</li><li>CAPICOM_STORE_OPEN_READ_WRITE</li><li>CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED</li><li>CAPICOM_STORE_OPEN_EXISTING_ONLY</li><li>CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED</li></ul> | 0x80880232 |
| CAPICOM_E_STORE_INVALID_SAVE_AS_TYPE | The SaveAs value passed to the <a href="store-export.md">Export</a> method of the <a href="store.md">Store</a> object was not valid. The following list shows the valid SaveAs values:<ul><li>CAPICOM_STORE_SAVE_AS_SERIALIZED</li><li>CAPICOM_STORE_SAVE_AS_PKCS7</li></ul> | 0x80880233 |
| CAPICOM_E_ATTRIBUTE_NAME_NOT_INITIALIZED | The <a href="attribute-name.md">Name</a> property of the <a href="attribute.md">Attribute</a> object has not been initialized. Set the <a href="attribute-name.md">Name</a> property. | 0x80880240 |
| CAPICOM_E_ATTRIBUTE_VALUE_NOT_INITIALIZED | The <a href="attribute-value.md">Value</a> property of the <a href="attribute.md">Attribute</a> object has not been initialized. Set the <a href="attribute-value.md">Value</a> property. | 0x80880241 |
| CAPICOM_E_ATTRIBUTE_INVALID_NAME | The <a href="attribute-name.md">Name</a> property of the <a href="attribute.md">Attribute</a> object is not valid. The following list shows the valid attribute names:<ul><li>CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME</li><li>CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME</li><li>CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION</li></ul> | 0x80880242 |
| CAPICOM_E_ATTRIBUTE_INVALID_VALUE | The <a href="attribute-value.md">Value</a> property of the <a href="attribute.md">Attribute</a> object is not valid because the data type does not match the data type indicated by the Name property. For example, if the <a href="attribute-value.md">Name</a> property is set to CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME, the data type must be DATE. | 0x80880243 |
| CAPICOM_E_SIGNER_NOT_INITIALIZED | The <a href="signer.md">Signer</a> object has not been initialized. To initialize the <a href="signer.md">Signer</a> object, set the <a href="signer-certificate.md">Certificate</a> property. | 0x80880250 |
| CAPICOM_E_SIGNER_NOT_FOUND | The signer cannot be found in the <a href="signeddata.md">SignedData</a> object. Usually, this does not happen with a <a href="signeddata.md">SignedData</a> 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. | 0x80880251 |
| CAPICOM_E_SIGNER_NO_CHAIN | A <a href="chain.md">Chain</a> object cannot be found in the <a href="signer.md">Signer</a> object. | 0x80880252 // v2.0 |
| CAPICOM_E_SIGNER_INVALID_USAGE | An attempt is made to use the signer in a way that is not valid. | 0x80880253 //v2.0 |
| CAPICOM_E_SIGN_NOT_INITIALIZED | The <a href="signeddata.md">SignedData</a> object has not been initialized. To initialize the <a href="signeddata.md">SignedData</a> object, set the <a href="signeddata-content.md">Content</a> property or call the <a href="signeddata-verify.md">Verify</a> method. | 0x80880260 |
| CAPICOM_E_SIGN_INVALID_TYPE | The <a href="signeddata.md">SignedData</a> object contains a type that is not valid. Usually, this happens when an attempt is made to verify an enveloped message with a <a href="signeddata.md">SignedData</a> object or vice versa. | 0x80880261 |
| CAPICOM_E_SIGN_NOT_SIGNED | The <a href="signeddata.md">SignedData</a> object has not been signed. To sign the <a href="signeddata.md">SignedData</a> object, call the <a href="signeddata-sign.md">Sign</a> method. | 0x80880262 |
| CAPICOM_E_INVALID_ALGORITHM | The algorithm value for the <a href="algorithm-name.md">Name</a> property of the <a href="algorithm.md">Algorithm</a> object is not valid. The following list shows the valid algorithm values for the <a href="algorithm-name.md">Name</a> property:<ul><li>CAPICOM_ENCRYPTION_ALGORITHM_RC2</li><li>CAPICOM_ENCRYPTION_ALGORITHM_RC4</li><li>CAPICOM_ENCRYPTION_ALGORITHM_DES</li><li>CAPICOM_ENCRYPTION_ALGORITHM_3DES</li></ul> | 0x80880270 |
| CAPICOM_E_INVALID_KEY_LENGTH | The key length value for the <a href="algorithm-keylength.md">KeyLength</a> property of the <a href="algorithm.md">Algorithm</a> object is not valid. The following list shows the valid key length values for the <a href="algorithm-keylength.md">KeyLength</a> property:<ul><li>CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM</li><li>CAPICOM_ENCRYPTION_KEY_LENGTH_40_BITS</li><li>CAPICOM_ENCRYPTION_KEY_LENGTH_56_BITS</li><li>CAPICOM_ENCRYPTION_KEY_LENGTH_128_BITS</li></ul> | 0x80880271 |
| CAPICOM_E_ENVELOP_NOT_INITIALIZED | The <a href="envelopeddata.md">EnvelopedData</a> object has not been initialized. To initialize the <a href="envelopeddata.md">EnvelopedData</a> object, either set the <a href="envelopeddata-content.md">Content</a> property or call the <a href="envelopeddata-decrypt.md">Decrypt</a> method. | 0x80880280 |
| CAPICOM_E_ENVELOP_INVALID_TYPE | The <a href="envelopeddata.md">EnvelopedData</a> object contains a type that is not valid. Usually, this happens when an attempt is made to verify a signed message with an <a href="envelopeddata.md">EnvelopedData</a> object or vice versa. | 0x80880281 |
| CAPICOM_E_ENVELOP_NO_RECIPIENT | There is no recipient specified in the <a href="envelopeddata.md">EnvelopedData</a> object when the <a href="envelopeddata-encrypt.md">Encrypt</a> method of an EnvelopedData object is called. To add a recipient, call the <a href="recipients-add.md">Recipients.Add</a> method. | 0x80880282 |
| CAPICOM_E_ENVELOP_RECIPIENT_NOT_FOUND | The recipient cannot be found in the <a href="envelopeddata.md">EnvelopedData</a> object. Usually, this does not happen with an <a href="envelopeddata.md">EnvelopedData</a> 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. | 0x80880283 |
| CAPICOM_E_ENCRYPT_NOT_INITIALIZED | The <a href="encrypteddata.md">EncryptedData</a> object has not been initialized. To initialize the <a href="encrypteddata.md">EncryptedData</a> object, either set the <a href="encrypteddata-content.md">Content</a> property or call the <a href="encrypteddata-decrypt.md">Decrypt</a> method. | 0x80880290 |
| CAPICOM_E_ENCRYPT_INVALID_TYPE | The <a href="encrypteddata.md">EncryptedData</a> object is not a valid type. Usually, this means the data is corrupted. | 0x80880291 |
| CAPICOM_E_ENCRYPT_NO_SECRET | The secret of an <a href="encrypteddata.md">EncryptedData</a> object has not been initialized. To initialize the secret of an <a href="encrypteddata.md">EncryptedData</a> object, call the <a href="encrypteddata-setsecret.md">SetSecret</a> method. | 0x80880292 |
| CAPICOM_E_PRIVATE_KEY_NOT_INITIALIZED | The <a href="privatekey.md">PrivateKey</a> object has not been initialized. | 0x80880300 // v2.0 |
| CAPICOM_E_PRIVATE_KEY_NOT_EXPORTABLE | The <a href="privatekey.md">PrivateKey</a> object cannot be exported. | 0x80880301 // v2.0 |
| CAPICOM_E_ENCODE_NOT_INITIALIZED | The <a href="encodeddata.md">EncodedData</a> object has not been initialized. | 0x80880320 // v2.0 |
| CAPICOM_E_EXTENSION_NOT_INITIALIZED | The <a href="extension.md">Extension</a> object has not been initialized. | 0x80880330 // v2.0 |
| CAPICOM_E_PROPERTY_NOT_INITIALIZED | The <a href="extendedproperty-propid.md">PropID</a> property of the <a href="extendedproperty.md">ExtendedProperty</a> object has not been initialized. | 0x80880340 // v2.0 |
| CAPICOM_E_FIND_INVALID_TYPE | The FindType parameter of the <a href="certificates-find.md">Certificates.Find</a> method is not a value of the <a href="capicom-certificate-find-type.md">CAPICOM_CERTIFICATE_FIND_TYPE</a> enumeration. | 0x80880350 // v2.0 |
| CAPICOM_E_FIND_INVALID_PREDEFINED_POLICY | The specified predefined policy for the find operation is not valid. | 0x80880351 // v2.0 |
| CAPICOM_E_CODE_NOT_INITIALIZED | The <a href="signedcode.md">SignedCode</a> object has not been initialized. | 0x80880360 // v2.0 |
| CAPICOM_E_CODE_NOT_SIGNED | The <a href="signedcode.md">SignedCode</a> object has not been signed. To sign the <a href="signedcode.md">SignedCode</a> object, call the <a href="signedcode-sign.md">Sign</a> method. | 0x80880361 // v2.0 |
| CAPICOM_E_CODE_DESCRIPTION_NOT_INITIALIZED | The <a href="signedcode-description.md">Description</a> property of the <a href="signedcode.md">SignedCode</a> object has not been initialized. | 0x80880362 // v2.0 |
| CAPICOM_E_CODE_DESCRIPTION_URL_NOT_INITIALIZED | The <a href="signedcode-descriptionurl.md">DescriptionURL</a> property of the <a href="signedcode.md">SignedCode</a> object has not been initialized. | 0x80880363 // v2.0 |
| CAPICOM_E_CODE_INVALID_TIMESTAMP_URL | The URL parameter of the <a href="signedcode-timestamp.md">SignedCode.Timestamp</a> method is not valid. | 0x80880364 // v2.0 |
| CAPICOM_E_HASH_NO_DATA | The <a href="hasheddata.md">HashedData</a> object does not contain any data. | 0x80880370 // v2.0 |
| CAPICOM_E_INVALID_CONVERT_TYPE | The convert type is not valid. | 0x80880380 // v2.0 |
| CAPICOM_E_NOT_SUPPORTED | The requested operation is not supported in the current platform. | 0x80880900 |
| CAPICOM_E_UI_DISABLED | When signing, the <a href="signer-certificate.md">Certificate</a> property of the <a href="signer.md">Signer</a> object has not been set, but the prompt for the user certificate has been disabled. Either enable the prompt by setting the <a href="settings-enablepromptforcertificateui.md">EnablePromptForCertificateUI</a> property of the <a href="settings.md">Settings</a> object, or set the <a href="signer-certificate.md">Certificate</a> property of the <a href="signer.md">Signer</a> object. | 0x80880901 |
| CAPICOM_E_CANCELLED | 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. | 0x80880902 |
| CAPICOM_E_NOT_ALLOWED | The attempted operation is not allowed. For example, changing the <a href="extendedproperty-propid.md">PropID</a> property of an <a href="extendedproperty.md">ExtendedProperty</a> object is not allowed if the object is attached to a certificate. | 0x80880903 // v2.0 |
| CAPICOM_E_OUT_OF_RESOURCE | CAPICOM has run out of a resource. | 0x80880904 // v2.0 |
| CAPICOM_E_INTERNAL | An internal error has occurred. Contact Microsoft Technical Support for assistance. | 0x80880911 |
| CAPICOM_E_UNKNOWN | An unknown error has occurred. Collect as much information as possible, and contact your vendor. | 0x80880999 |
Requirements
| Requirement | Value |
|---|---|
| Redistributable | CAPICOM 2.0 or later on Windows Server 2003 and Windows XP |
| Header | Capicom.h |
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
