Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2672 lines
102 KiB

// CAPICOM.idl : IDL source for CAPICOM.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (CAPICOM.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
import "wincrypt.idl";
//
// CAPICOM
//
[
uuid(BD26B198-EE42-4725-9B23-AFA912434229),
version(2.0),
helpstring("CAPICOM v2.0 Type Library")
]
library CAPICOM
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
//
// Error codes.
//
typedef enum CAPICOM_ERROR_CODE
{
CAPICOM_E_ENCODE_INVALID_TYPE = 0x80880100,
CAPICOM_E_EKU_INVALID_OID = 0x80880200,
CAPICOM_E_EKU_OID_NOT_INITIALIZED = 0x80880201,
CAPICOM_E_CERTIFICATE_NOT_INITIALIZED = 0x80880210,
CAPICOM_E_CERTIFICATE_NO_PRIVATE_KEY = 0x80880211,
CAPICOM_E_CHAIN_NOT_BUILT = 0x80880220,
CAPICOM_E_STORE_NOT_OPENED = 0x80880230,
CAPICOM_E_STORE_EMPTY = 0x80880231,
CAPICOM_E_STORE_INVALID_OPEN_MODE = 0x80880232,
CAPICOM_E_STORE_INVALID_SAVE_AS_TYPE = 0x80880233,
CAPICOM_E_ATTRIBUTE_NAME_NOT_INITIALIZED = 0x80880240,
CAPICOM_E_ATTRIBUTE_VALUE_NOT_INITIALIZED = 0x80880241,
CAPICOM_E_ATTRIBUTE_INVALID_NAME = 0x80880242,
CAPICOM_E_ATTRIBUTE_INVALID_VALUE = 0x80880243,
CAPICOM_E_SIGNER_NOT_INITIALIZED = 0x80880250,
CAPICOM_E_SIGNER_NOT_FOUND = 0x80880251,
CAPICOM_E_SIGNER_NO_CHAIN = 0x80880252, // v2.0
CAPICOM_E_SIGNER_INVALID_USAGE = 0x80880253, // v2.0
CAPICOM_E_SIGN_NOT_INITIALIZED = 0x80880260,
CAPICOM_E_SIGN_INVALID_TYPE = 0x80880261,
CAPICOM_E_SIGN_NOT_SIGNED = 0x80880262,
CAPICOM_E_INVALID_ALGORITHM = 0x80880270,
CAPICOM_E_INVALID_KEY_LENGTH = 0x80880271,
CAPICOM_E_ENVELOP_NOT_INITIALIZED = 0x80880280,
CAPICOM_E_ENVELOP_INVALID_TYPE = 0x80880281,
CAPICOM_E_ENVELOP_NO_RECIPIENT = 0x80880282,
CAPICOM_E_ENVELOP_RECIPIENT_NOT_FOUND = 0x80880283,
CAPICOM_E_ENCRYPT_NOT_INITIALIZED = 0x80880290,
CAPICOM_E_ENCRYPT_INVALID_TYPE = 0x80880291,
CAPICOM_E_ENCRYPT_NO_SECRET = 0x80880292,
CAPICOM_E_NOT_SUPPORTED = 0x80880900,
CAPICOM_E_UI_DISABLED = 0x80880901,
CAPICOM_E_CANCELLED = 0x80880902,
CAPICOM_E_NOT_ALLOWED = 0x80880903, // v2.0
CAPICOM_E_OUT_OF_RESOURCE = 0x80880904, // v2.0
CAPICOM_E_INTERNAL = 0x80880911,
CAPICOM_E_UNKNOWN = 0x80880999,
//
// CAPICOM v2.0.
//
CAPICOM_E_PRIVATE_KEY_NOT_INITIALIZED = 0x80880300,
CAPICOM_E_PRIVATE_KEY_NOT_EXPORTABLE = 0x80880301,
CAPICOM_E_ENCODE_NOT_INITIALIZED = 0x80880320,
CAPICOM_E_EXTENSION_NOT_INITIALIZED = 0x80880330,
CAPICOM_E_PROPERTY_NOT_INITIALIZED = 0x80880340,
CAPICOM_E_FIND_INVALID_TYPE = 0x80880350,
CAPICOM_E_FIND_INVALID_PREDEFINED_POLICY = 0x80880351,
CAPICOM_E_CODE_NOT_INITIALIZED = 0x80880360,
CAPICOM_E_CODE_NOT_SIGNED = 0x80880361,
CAPICOM_E_CODE_DESCRIPTION_NOT_INITIALIZED = 0x80880362,
CAPICOM_E_CODE_DESCRIPTION_URL_NOT_INITIALIZED = 0x80880363,
CAPICOM_E_CODE_INVALID_TIMESTAMP_URL = 0x80880364,
CAPICOM_E_HASH_NO_DATA = 0x80880370,
CAPICOM_E_INVALID_CONVERT_TYPE = 0x80880380,
} CAPICOM_ERROR_CODE;
//
// Enumerated data types.
//
typedef enum CAPICOM_ENCODING_TYPE
{
CAPICOM_ENCODE_BASE64 = 0,
CAPICOM_ENCODE_BINARY = 1,
// v2.0
CAPICOM_ENCODE_ANY = 0xffffffff,
} CAPICOM_ENCODING_TYPE;
typedef enum CAPICOM_EKU
{
CAPICOM_EKU_OTHER = 0,
CAPICOM_EKU_SERVER_AUTH = 1,
CAPICOM_EKU_CLIENT_AUTH = 2,
CAPICOM_EKU_CODE_SIGNING = 3,
CAPICOM_EKU_EMAIL_PROTECTION = 4,
// v2.0
CAPICOM_EKU_SMARTCARD_LOGON = 5,
CAPICOM_EKU_ENCRYPTING_FILE_SYSTEM = 6,
} CAPICOM_EKU;
typedef enum CAPICOM_CHECK_FLAG
{
CAPICOM_CHECK_NONE = 0x00000000,
CAPICOM_CHECK_TRUSTED_ROOT = 0x00000001,
CAPICOM_CHECK_TIME_VALIDITY = 0x00000002,
CAPICOM_CHECK_SIGNATURE_VALIDITY = 0x00000004,
CAPICOM_CHECK_ONLINE_REVOCATION_STATUS = 0x00000008,
CAPICOM_CHECK_OFFLINE_REVOCATION_STATUS = 0x00000010,
// v2.0
CAPICOM_CHECK_COMPLETE_CHAIN = 0x00000020,
CAPICOM_CHECK_NAME_CONSTRAINTS = 0x00000040,
CAPICOM_CHECK_BASIC_CONSTRAINTS = 0x00000080,
CAPICOM_CHECK_NESTED_VALIDITY_PERIOD = 0x00000100,
CAPICOM_CHECK_ONLINE_ALL = 0x000001EF,
CAPICOM_CHECK_OFFLINE_ALL = 0x000001F7,
} CAPICOM_CHECK_FLAG;
//
// The upper 16 bits are used for additional flags.
//
cpp_quote("#define CAPICOM_CHECK_FLAG_LO_MASK 0x0000ffff")
cpp_quote("#define CAPICOM_CHECK_FLAG_HI_MASK 0xffff0000")
cpp_quote("#define CAPICOM_CHECK_APPLICATION_USAGE 0x00010000")
cpp_quote("#define CAPICOM_CHECK_CERTIFICATE_POLICY 0x00020000")
cpp_quote("#define CAPICOM_CHECK_REVOCATION_END_CERT_ONLY 0x00040000")
cpp_quote("#define CAPICOM_CHECK_REVOCATION_ENTIRE_CHAIN 0x00080000")
typedef enum CAPICOM_CERT_INFO_TYPE
{
CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0,
CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1,
CAPICOM_CERT_INFO_SUBJECT_EMAIL_NAME = 2,
CAPICOM_CERT_INFO_ISSUER_EMAIL_NAME = 3,
// v2.0
CAPICOM_CERT_INFO_SUBJECT_UPN = 4,
CAPICOM_CERT_INFO_ISSUER_UPN = 5,
CAPICOM_CERT_INFO_SUBJECT_DNS_NAME = 6,
CAPICOM_CERT_INFO_ISSUER_DNS_NAME = 7,
//CAPICOM_CERT_INFO_SUBJECT_IP_ADDRESS = 8,
//CAPICOM_CERT_INFO_ISSUER_IP_ADDRESS = 9,
} CAPICOM_CERT_INFO_TYPE;
typedef enum CAPICOM_STORE_LOCATION
{
CAPICOM_MEMORY_STORE = 0,
CAPICOM_LOCAL_MACHINE_STORE = 1,
CAPICOM_CURRENT_USER_STORE = 2,
CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3,
// v2.0
CAPICOM_SMART_CARD_USER_STORE = 4,
} CAPICOM_STORE_LOCATION;
typedef enum CAPICOM_STORE_OPEN_MODE
{
CAPICOM_STORE_OPEN_READ_ONLY = 0,
CAPICOM_STORE_OPEN_READ_WRITE = 1,
CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2,
// v2.0
CAPICOM_STORE_OPEN_EXISTING_ONLY = 128,
CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256,
} CAPICOM_STORE_OPEN_MODE;
typedef enum CAPICOM_ACTIVE_DIRECTORY_SEARCH_LOCATION
{
CAPICOM_SEARCH_ANY = 0,
CAPICOM_SEARCH_GLOBAL_CATALOG = 1,
CAPICOM_SEARCH_DEFAULT_DOMAIN = 2,
} CAPICOM_ACTIVE_DIRECTORY_SEARCH_LOCATION;
typedef enum CAPICOM_STORE_SAVE_AS_TYPE
{
CAPICOM_STORE_SAVE_AS_SERIALIZED = 0,
CAPICOM_STORE_SAVE_AS_PKCS7 = 1,
} CAPICOM_STORE_SAVE_AS_TYPE;
typedef enum CAPICOM_ATTRIBUTE
{
CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0,
CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1,
CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2,
} CAPICOM_ATTRIBUTE;
typedef enum CAPICOM_SIGNED_DATA_VERIFY_FLAG
{
CAPICOM_VERIFY_SIGNATURE_ONLY = 0,
CAPICOM_VERIFY_SIGNATURE_AND_CERTIFICATE = 1,
} CAPICOM_SIGNED_DATA_VERIFY_FLAG;
typedef enum CAPICOM_ENCRYPTION_ALGORITHM
{
CAPICOM_ENCRYPTION_ALGORITHM_RC2 = 0,
CAPICOM_ENCRYPTION_ALGORITHM_RC4 = 1,
CAPICOM_ENCRYPTION_ALGORITHM_DES = 2,
CAPICOM_ENCRYPTION_ALGORITHM_3DES = 3,
// v2.0
CAPICOM_ENCRYPTION_ALGORITHM_AES = 4,
} CAPICOM_ENCRYPTION_ALGORITHM;
typedef enum CAPICOM_ENCRYPTION_KEY_LENGTH
{
CAPICOM_ENCRYPTION_KEY_LENGTH_MAXIMUM = 0,
CAPICOM_ENCRYPTION_KEY_LENGTH_40_BITS = 1,
CAPICOM_ENCRYPTION_KEY_LENGTH_56_BITS = 2,
CAPICOM_ENCRYPTION_KEY_LENGTH_128_BITS = 3,
// v2.0 (AES only)
CAPICOM_ENCRYPTION_KEY_LENGTH_192_BITS = 4,
CAPICOM_ENCRYPTION_KEY_LENGTH_256_BITS = 5,
} CAPICOM_ENCRYPTION_KEY_LENGTH;
typedef enum CAPICOM_SECRET_TYPE
{
CAPICOM_SECRET_PASSWORD = 0,
} CAPICOM_SECRET_TYPE;
typedef enum CAPICOM_KEY_ALGORITHM
{
CAPICOM_KEY_ALGORITHM_OTHER = 0,
CAPICOM_KEY_ALGORITHM_RSA = 1,
CAPICOM_KEY_ALGORITHM_DSS = 2,
} CAPICOM_KEY_ALGORITHM;
////////////////////////////////////////////////////////////////////////////
//
// CAPICOM v2.0
//
typedef enum CAPICOM_OID
{
CAPICOM_OID_OTHER = 0,
// id-ce
CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER_EXTENSION = 1,
CAPICOM_OID_KEY_ATTRIBUTES_EXTENSION = 2,
CAPICOM_OID_CERT_POLICIES_95_EXTENSION = 3,
CAPICOM_OID_KEY_USAGE_RESTRICTION_EXTENSION = 4,
CAPICOM_OID_LEGACY_POLICY_MAPPINGS_EXTENSION = 5,
CAPICOM_OID_SUBJECT_ALT_NAME_EXTENSION = 6,
CAPICOM_OID_ISSUER_ALT_NAME_EXTENSION = 7,
CAPICOM_OID_BASIC_CONSTRAINTS_EXTENSION = 8,
CAPICOM_OID_SUBJECT_KEY_IDENTIFIER_EXTENSION = 9,
CAPICOM_OID_KEY_USAGE_EXTENSION = 10,
CAPICOM_OID_PRIVATEKEY_USAGE_PERIOD_EXTENSION = 11,
CAPICOM_OID_SUBJECT_ALT_NAME2_EXTENSION = 12,
CAPICOM_OID_ISSUER_ALT_NAME2_EXTENSION = 13,
CAPICOM_OID_BASIC_CONSTRAINTS2_EXTENSION = 14,
CAPICOM_OID_NAME_CONSTRAINTS_EXTENSION = 15,
CAPICOM_OID_CRL_DIST_POINTS_EXTENSION = 16,
CAPICOM_OID_CERT_POLICIES_EXTENSION = 17,
CAPICOM_OID_POLICY_MAPPINGS_EXTENSION = 18,
CAPICOM_OID_AUTHORITY_KEY_IDENTIFIER2_EXTENSION = 19,
CAPICOM_OID_POLICY_CONSTRAINTS_EXTENSION = 20,
CAPICOM_OID_ENHANCED_KEY_USAGE_EXTENSION = 21,
CAPICOM_OID_CERTIFICATE_TEMPLATE_EXTENSION = 22,
CAPICOM_OID_APPLICATION_CERT_POLICIES_EXTENSION = 23,
CAPICOM_OID_APPLICATION_POLICY_MAPPINGS_EXTENSION = 24,
CAPICOM_OID_APPLICATION_POLICY_CONSTRAINTS_EXTENSION = 25,
// id-pe
CAPICOM_OID_AUTHORITY_INFO_ACCESS_EXTENSION = 26,
// eku
CAPICOM_OID_SERVER_AUTH_EKU = 100,
CAPICOM_OID_CLIENT_AUTH_EKU = 101,
CAPICOM_OID_CODE_SIGNING_EKU = 102,
CAPICOM_OID_EMAIL_PROTECTION_EKU = 103,
CAPICOM_OID_IPSEC_END_SYSTEM_EKU = 104,
CAPICOM_OID_IPSEC_TUNNEL_EKU = 105,
CAPICOM_OID_IPSEC_USER_EKU = 106,
CAPICOM_OID_TIME_STAMPING_EKU = 107,
CAPICOM_OID_CTL_USAGE_SIGNING_EKU = 108,
CAPICOM_OID_TIME_STAMP_SIGNING_EKU = 109,
CAPICOM_OID_SERVER_GATED_CRYPTO_EKU = 110,
CAPICOM_OID_ENCRYPTING_FILE_SYSTEM_EKU = 111,
CAPICOM_OID_EFS_RECOVERY_EKU = 112,
CAPICOM_OID_WHQL_CRYPTO_EKU = 113,
CAPICOM_OID_NT5_CRYPTO_EKU = 114,
CAPICOM_OID_OEM_WHQL_CRYPTO_EKU = 115,
CAPICOM_OID_EMBEDED_NT_CRYPTO_EKU = 116,
CAPICOM_OID_ROOT_LIST_SIGNER_EKU = 117,
CAPICOM_OID_QUALIFIED_SUBORDINATION_EKU = 118,
CAPICOM_OID_KEY_RECOVERY_EKU = 119,
CAPICOM_OID_DIGITAL_RIGHTS_EKU = 120,
CAPICOM_OID_LICENSES_EKU = 121,
CAPICOM_OID_LICENSE_SERVER_EKU = 122,
CAPICOM_OID_SMART_CARD_LOGON_EKU = 123,
// Policy Qualifier
CAPICOM_OID_PKIX_POLICY_QUALIFIER_CPS = 124,
CAPICOM_OID_PKIX_POLICY_QUALIFIER_USERNOTICE = 125,
} CAPICOM_OID;
typedef enum CAPICOM_PROPID
{
CAPICOM_PROPID_UNKNOWN = 0,
CAPICOM_PROPID_KEY_PROV_HANDLE = 1,
CAPICOM_PROPID_KEY_PROV_INFO = 2,
CAPICOM_PROPID_SHA1_HASH = 3,
CAPICOM_PROPID_HASH_PROP = 3,
CAPICOM_PROPID_MD5_HASH = 4,
CAPICOM_PROPID_KEY_CONTEXT = 5,
CAPICOM_PROPID_KEY_SPEC = 6,
CAPICOM_PROPID_IE30_RESERVED = 7,
CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8,
CAPICOM_PROPID_ENHKEY_USAGE = 9,
CAPICOM_PROPID_CTL_USAGE = 9,
CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10,
CAPICOM_PROPID_FRIENDLY_NAME = 11,
CAPICOM_PROPID_PVK_FILE = 12,
CAPICOM_PROPID_DESCRIPTION = 13,
CAPICOM_PROPID_ACCESS_STATE = 14,
CAPICOM_PROPID_SIGNATURE_HASH = 15,
CAPICOM_PROPID_SMART_CARD_DATA = 16,
CAPICOM_PROPID_EFS = 17,
CAPICOM_PROPID_FORTEZZA_DATA = 18,
CAPICOM_PROPID_ARCHIVED = 19,
CAPICOM_PROPID_KEY_IDENTIFIER = 20,
CAPICOM_PROPID_AUTO_ENROLL = 21,
CAPICOM_PROPID_PUBKEY_ALG_PARA = 22,
CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23,
CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24,
CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25,
CAPICOM_PROPID_ENROLLMENT = 26,
CAPICOM_PROPID_DATE_STAMP = 27,
CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28,
CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29,
CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30,
// Note, 32 - 35 are reserved for the CERT, CRL 32 - 35 are reserved for the CERT, CRL, CTL and
// 36 - 63 are reserved for future elemen 36 - 63 are reserved for future element IDs.
CAPICOM_PROPID_RENEWAL = 64,
CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65,
CAPICOM_PROPID_FIRST_RESERVED = 66,
CAPICOM_PROPID_LAST_RESERVED = 0x00007FFF,
CAPICOM_PROPID_FIRST_USER = 0x00008000,
CAPICOM_PROPID_LAST_USER = 0x0000FFFF,
} CAPICOM_PROPID;
//
// Provider type.
//
typedef enum CAPICOM_PROV_TYPE
{
CAPICOM_PROV_RSA_FULL = 1,
CAPICOM_PROV_RSA_SIG = 2,
CAPICOM_PROV_DSS = 3,
CAPICOM_PROV_FORTEZZA = 4,
CAPICOM_PROV_MS_EXCHANGE = 5,
CAPICOM_PROV_SSL = 6,
CAPICOM_PROV_RSA_SCHANNEL = 12,
CAPICOM_PROV_DSS_DH = 13,
CAPICOM_PROV_EC_ECDSA_SIG = 14,
CAPICOM_PROV_EC_ECNRA_SIG = 15,
CAPICOM_PROV_EC_ECDSA_FULL = 16,
CAPICOM_PROV_EC_ECNRA_FULL = 17,
CAPICOM_PROV_DH_SCHANNEL = 18,
CAPICOM_PROV_SPYRUS_LYNKS = 20,
CAPICOM_PROV_RNG = 21,
CAPICOM_PROV_INTEL_SEC = 22,
CAPICOM_PROV_REPLACE_OWF = 23,
CAPICOM_PROV_RSA_AES = 24,
} CAPICOM_PROV_TYPE;
//
// Certificate save as type.
//
typedef enum CAPICOM_CERTIFICATE_SAVE_AS_TYPE
{
CAPICOM_CERTIFICATE_SAVE_AS_PFX = 0,
CAPICOM_CERTIFICATE_SAVE_AS_CER = 1,
} CAPICOM_CERTIFICATE_SAVE_AS_TYPE;
typedef enum CAPICOM_CERTIFICATES_SAVE_AS_TYPE
{
CAPICOM_CERTIFICATES_SAVE_AS_SERIALIZED = 0,
CAPICOM_CERTIFICATES_SAVE_AS_PKCS7 = 1,
CAPICOM_CERTIFICATES_SAVE_AS_PFX = 2,
} CAPICOM_CERTIFICATES_SAVE_AS_TYPE;
//
// Signer options.
//
typedef enum CAPICOM_CERTIFICATE_INCLUDE_OPTION
{
CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0,
CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1,
CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2,
} CAPICOM_CERTIFICATE_INCLUDE_OPTION;
//
// Key spec.
//
typedef enum CAPICOM_KEY_SPEC
{
CAPICOM_KEY_SPEC_KEYEXCHANGE = 1,
CAPICOM_KEY_SPEC_SIGNATURE = 2,
} CAPICOM_KEY_SPEC;
//
// Key storage location.
//
typedef enum CAPICOM_KEY_LOCATION
{
CAPICOM_CURRENT_USER_KEY = 0,
CAPICOM_LOCAL_MACHINE_KEY = 1,
} CAPICOM_KEY_LOCATION;
//
// Key storage flag.
//
typedef enum CAPICOM_KEY_STORAGE_FLAG
{
CAPICOM_KEY_STORAGE_DEFAULT = 0,
CAPICOM_KEY_STORAGE_EXPORTABLE = 1,
CAPICOM_KEY_STORAGE_USER_PROTECTED = 2,
} CAPICOM_KEY_STORAGE_FLAG;
//
// PFX export flag.
//
typedef enum CAPICOM_EXPORT_FLAG
{
CAPICOM_EXPORT_DEFAULT = 0,
CAPICOM_EXPORT_IGNORE_PRIVATE_KEY_NOT_EXPORTABLE_ERROR = 1,
} CAPICOM_EXPORT_FLAG;
//
// Key usage bit values.
//
typedef enum CAPICOM_KEY_USAGE
{
CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 0x00000080,
CAPICOM_NON_REPUDIATION_KEY_USAGE = 0x00000040,
CAPICOM_KEY_ENCIPHERMENT_KEY_USAGE = 0x00000020,
CAPICOM_DATA_ENCIPHERMENT_KEY_USAGE = 0x00000010,
CAPICOM_KEY_AGREEMENT_KEY_USAGE = 0x00000008,
CAPICOM_KEY_CERT_SIGN_KEY_USAGE = 0x00000004,
CAPICOM_OFFLINE_CRL_SIGN_KEY_USAGE = 0x00000002,
CAPICOM_CRL_SIGN_KEY_USAGE = 0x00000002,
CAPICOM_ENCIPHER_ONLY_KEY_USAGE = 0x00000001,
CAPICOM_DECIPHER_ONLY_KEY_USAGE = 0x00008000,
} CAPICOM_KEY_USAGE;
//
// Find type.
//
typedef enum CAPICOM_CERTIFICATE_FIND_TYPE
{
CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0,
CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1,
CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2,
CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3,
CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4,
CAPICOM_CERTIFICATE_FIND_EXTENSION = 5,
CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6,
CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7,
CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8,
CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9,
CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10,
CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11,
CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12,
} CAPICOM_CERTIFICATE_FIND_TYPE;
#if (0)
//
// Pre-defined policy for CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY.
//
typedef enum CAPICOM_CERTIFICATE_FIND_PREDEFINED_POLICY
{
CAPICOM_CERTIFICATE_FIND_DATA_SIGNINING_POLICY = 0,
CAPICOM_CERTIFICATE_FIND_AUTHENTICODE_POLICY = 1,
CAPICOM_CERTIFICATE_FIND_SECURE_EMAIL_POLICY = 2,
CAPICOM_CERTIFICATE_FIND_CLIENT_AUTHENTICATION_POLICY = 3,
CAPICOM_CERTIFICATE_FIND_SERVER_AUTHENTICATION_POLICY = 4,
CAPICOM_CERTIFICATE_FIND_SMARTCARD_LOGON_POLICY = 5,
CAPICOM_CERTIFICATE_FIND_WIRELESS_POLICY = 6,
} CAPICOM_CERTIFICATE_FIND_PREDEFINED_POLICY;
#endif
//
// Hashing algorithm.
//
typedef enum CAPICOM_HASH_ALGORITHM
{
CAPICOM_HASH_ALGORITHM_SHA1 = 0,
CAPICOM_HASH_ALGORITHM_MD2 = 1,
CAPICOM_HASH_ALGORITHM_MD4 = 2,
CAPICOM_HASH_ALGORITHM_MD5 = 3,
// CAPICOM_HASH_ALGORITHM_SHA_256 = 4,
// CAPICOM_HASH_ALGORITHM_SHA_384 = 5,
// CAPICOM_HASH_ALGORITHM_SHA_512 = 6,
} CAPICOM_HASH_ALGORITHM;
//
// Constants.
//
[dllname("CAPICOM")]
module Constants
{
//
// CAPICOM version.
//
const long CAPICOM_MAJOR_VERSION = 2;
const long CAPICOM_MINOR_VERSION = 0;
const LPSTR CAPICOM_VERSION_INFO = "CAPICOM v2.0";
const LPSTR CAPICOM_COPY_RIGHT = "Copyright (c) Microsoft Corporation 1999-2002. All rights reserved.";
//
// System store names.
//
const LPSTR CAPICOM_MY_STORE = "My";
const LPSTR CAPICOM_CA_STORE = "Ca";
const LPSTR CAPICOM_ROOT_STORE = "Root";
const LPSTR CAPICOM_OTHER_STORE = "AddressBook";
//
// Enhanced Key Usage OIDs (obselete, use the new constants below instead).
//
const LPSTR CAPICOM_OID_SERVER_AUTH = "1.3.6.1.5.5.7.3.1";
const LPSTR CAPICOM_OID_CLIENT_AUTH = "1.3.6.1.5.5.7.3.2";
const LPSTR CAPICOM_OID_CODE_SIGNING = "1.3.6.1.5.5.7.3.3";
const LPSTR CAPICOM_OID_EMAIL_PROTECTION = "1.3.6.1.5.5.7.3.4";
const LPSTR CAPICOM_OID_IPSEC_END_SYSTEM = "1.3.6.1.5.5.7.3.5";
const LPSTR CAPICOM_OID_IPSEC_TUNNEL = "1.3.6.1.5.5.7.3.6";
const LPSTR CAPICOM_OID_IPSEC_USER = "1.3.6.1.5.5.7.3.7";
const LPSTR CAPICOM_OID_TIME_STAMPING = "1.3.6.1.5.5.7.3.8";
const LPSTR CAPICOM_OID_CTL_USAGE_SIGNING = "1.3.6.1.4.1.311.10.3.1";
const LPSTR CAPICOM_OID_TIME_STAMP_SIGNING = "1.3.6.1.4.1.311.10.3.2";
const LPSTR CAPICOM_OID_SERVER_GATED_CRYPTO = "1.3.6.1.4.1.311.10.3.3";
const LPSTR CAPICOM_OID_ENCRYPTING_FILE_SYSTEM = "1.3.6.1.4.1.311.10.3.4";
const LPSTR CAPICOM_OID_EFS_RECOVERY = "1.3.6.1.4.1.311.10.3.4.1";
const LPSTR CAPICOM_OID_WHQL_CRYPTO = "1.3.6.1.4.1.311.10.3.5";
const LPSTR CAPICOM_OID_NT5_CRYPTO = "1.3.6.1.4.1.311.10.3.6";
const LPSTR CAPICOM_OID_OEM_WHQL_CRYPTO = "1.3.6.1.4.1.311.10.3.7";
const LPSTR CAPICOM_OID_EMBEDED_NT_CRYPTO = "1.3.6.1.4.1.311.10.3.8";
const LPSTR CAPICOM_OID_ROOT_LIST_SIGNER = "1.3.6.1.4.1.311.10.3.9";
const LPSTR CAPICOM_OID_QUALIFIED_SUBORDINATION = "1.3.6.1.4.1.311.10.3.10";
const LPSTR CAPICOM_OID_KEY_RECOVERY = "1.3.6.1.4.1.311.10.3.11";
const LPSTR CAPICOM_OID_DIGITAL_RIGHTS = "1.3.6.1.4.1.311.10.5.1";
const LPSTR CAPICOM_OID_LICENSES = "1.3.6.1.4.1.311.10.6.1";
const LPSTR CAPICOM_OID_LICENSE_SERVER = "1.3.6.1.4.1.311.10.6.2";
const LPSTR CAPICOM_OID_SMART_CARD_LOGON = "1.3.6.1.4.1.311.20.2.2";
//
// New usage OIDs.
//
const LPSTR CAPICOM_SERVER_AUTH_OID = "1.3.6.1.5.5.7.3.1";
const LPSTR CAPICOM_CLIENT_AUTH_OID = "1.3.6.1.5.5.7.3.2";
const LPSTR CAPICOM_CODE_SIGNING_OID = "1.3.6.1.5.5.7.3.3";
const LPSTR CAPICOM_EMAIL_PROTECTION_OID = "1.3.6.1.5.5.7.3.4";
const LPSTR CAPICOM_IPSEC_END_SYSTEM_OID = "1.3.6.1.5.5.7.3.5";
const LPSTR CAPICOM_IPSEC_TUNNEL_OID = "1.3.6.1.5.5.7.3.6";
const LPSTR CAPICOM_IPSEC_USER_OID = "1.3.6.1.5.5.7.3.7";
const LPSTR CAPICOM_TIME_STAMPING_OID = "1.3.6.1.5.5.7.3.8";
const LPSTR CAPICOM_CTL_USAGE_SIGNING_OID = "1.3.6.1.4.1.311.10.3.1";
const LPSTR CAPICOM_TIME_STAMP_SIGNING_OID = "1.3.6.1.4.1.311.10.3.2";
const LPSTR CAPICOM_SERVER_GATED_CRYPTO_OID = "1.3.6.1.4.1.311.10.3.3";
const LPSTR CAPICOM_ENCRYPTING_FILE_SYSTEM_OID = "1.3.6.1.4.1.311.10.3.4";
const LPSTR CAPICOM_EFS_RECOVERY_OID = "1.3.6.1.4.1.311.10.3.4.1";
const LPSTR CAPICOM_WHQL_CRYPTO_OID = "1.3.6.1.4.1.311.10.3.5";
const LPSTR CAPICOM_NT5_CRYPTO_OID = "1.3.6.1.4.1.311.10.3.6";
const LPSTR CAPICOM_OEM_WHQL_CRYPTO_OID = "1.3.6.1.4.1.311.10.3.7";
const LPSTR CAPICOM_EMBEDED_NT_CRYPTO_OID = "1.3.6.1.4.1.311.10.3.8";
const LPSTR CAPICOM_ROOT_LIST_SIGNER_OID = "1.3.6.1.4.1.311.10.3.9";
const LPSTR CAPICOM_QUALIFIED_SUBORDINATION_OID = "1.3.6.1.4.1.311.10.3.10";
const LPSTR CAPICOM_KEY_RECOVERY_OID = "1.3.6.1.4.1.311.10.3.11";
const LPSTR CAPICOM_DIGITAL_RIGHTS_OID = "1.3.6.1.4.1.311.10.5.1";
const LPSTR CAPICOM_LICENSES_OID = "1.3.6.1.4.1.311.10.6.1";
const LPSTR CAPICOM_LICENSE_SERVER_OID = "1.3.6.1.4.1.311.10.6.2";
const LPSTR CAPICOM_SMART_CARD_LOGON_OID = "1.3.6.1.4.1.311.20.2.2";
const LPSTR CAPICOM_ANY_APPLICATION_POLICY_OID = "1.3.6.1.4.1.311.10.12.1";
const LPSTR CAPICOM_ANY_CERT_POLICY_OID = "2.5.29.32.0";
//
// Extension OIDs.
//
const LPSTR CAPICOM_AUTHORITY_KEY_IDENTIFIER_OID = "2.5.29.1";
const LPSTR CAPICOM_KEY_ATTRIBUTES_OID = "2.5.29.2";
const LPSTR CAPICOM_CERT_POLICIES_95_OID = "2.5.29.3";
const LPSTR CAPICOM_KEY_USAGE_RESTRICTION_OID = "2.5.29.4";
const LPSTR CAPICOM_LEGACY_POLICY_MAPPINGS_OID = "2.5.29.5";
const LPSTR CAPICOM_SUBJECT_ALT_NAME_OID = "2.5.29.7";
const LPSTR CAPICOM_ISSUER_ALT_NAME_OID = "2.5.29.8";
const LPSTR CAPICOM_BASIC_CONSTRAINTS_OID = "2.5.29.10";
const LPSTR CAPICOM_SUBJECT_KEY_IDENTIFIER_OID = "2.5.29.14";
const LPSTR CAPICOM_KEY_USAGE_OID = "2.5.29.15";
const LPSTR CAPICOM_PRIVATEKEY_USAGE_PERIOD_OID = "2.5.29.16";
const LPSTR CAPICOM_SUBJECT_ALT_NAME2_OID = "2.5.29.17";
const LPSTR CAPICOM_ISSUER_ALT_NAME2_OID = "2.5.29.18";
const LPSTR CAPICOM_BASIC_CONSTRAINTS2_OID = "2.5.29.19";
const LPSTR CAPICOM_NAME_CONSTRAINTS_OID = "2.5.29.30";
const LPSTR CAPICOM_CRL_DIST_POINTS_OID = "2.5.29.31";
const LPSTR CAPICOM_CERT_POLICIES_OID = "2.5.29.32";
const LPSTR CAPICOM_POLICY_MAPPINGS_OID = "2.5.29.33";
const LPSTR CAPICOM_AUTHORITY_KEY_IDENTIFIER2_OID = "2.5.29.35";
const LPSTR CAPICOM_POLICY_CONSTRAINTS_OID = "2.5.29.36";
const LPSTR CAPICOM_ENHANCED_KEY_USAGE_OID = "2.5.29.37";
const LPSTR CAPICOM_CERTIFICATE_TEMPLATE_OID = "1.3.6.1.4.1.311.21.7";
const LPSTR CAPICOM_APPLICATION_CERT_POLICIES_OID = "1.3.6.1.4.1.311.21.10";
const LPSTR CAPICOM_APPLICATION_POLICY_MAPPINGS_OID = "1.3.6.1.4.1.311.21.11";
const LPSTR CAPICOM_APPLICATION_POLICY_CONSTRAINTS_OID = "1.3.6.1.4.1.311.21.12";
const LPSTR CAPICOM_AUTHORITY_INFO_ACCESS_OID = "1.3.6.1.5.5.7.1.1";
const LPSTR CAPICOM_PKIX_POLICY_QUALIFIER_CPS_OID = "1.3.6.1.5.5.7.2.1";
const LPSTR CAPICOM_PKIX_POLICY_QUALIFIER_USERNOTICE_OID = "1.3.6.1.5.5.7.2.2";
//
// Chain status.
//
const long CAPICOM_TRUST_IS_NOT_TIME_VALID = 0x00000001;
const long CAPICOM_TRUST_IS_NOT_TIME_NESTED = 0x00000002;
const long CAPICOM_TRUST_IS_REVOKED = 0x00000004;
const long CAPICOM_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008;
const long CAPICOM_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010;
const long CAPICOM_TRUST_IS_UNTRUSTED_ROOT = 0x00000020;
const long CAPICOM_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040;
const long CAPICOM_TRUST_IS_CYCLIC = 0x00000080;
const long CAPICOM_TRUST_INVALID_EXTENSION = 0x00000100;
const long CAPICOM_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200;
const long CAPICOM_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400;
const long CAPICOM_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800;
const long CAPICOM_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000;
const long CAPICOM_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000;
const long CAPICOM_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000;
const long CAPICOM_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000;
const long CAPICOM_TRUST_IS_OFFLINE_REVOCATION = 0x01000000;
const long CAPICOM_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000;
const long CAPICOM_TRUST_IS_PARTIAL_CHAIN = 0x00010000;
const long CAPICOM_TRUST_CTL_IS_NOT_TIME_VALID = 0x00020000;
const long CAPICOM_TRUST_CTL_IS_NOT_SIGNATURE_VALID = 0x00040000;
const long CAPICOM_TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 0x00080000;
//
// CSP providers.
//
const LPSTR CAPICOM_PROV_MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0";
const LPSTR CAPICOM_PROV_MS_ENHANCED_PROV = "Microsoft Enhanced Cryptographic Provider v1.0";
const LPSTR CAPICOM_PROV_MS_STRONG_PROV = "Microsoft Strong Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_DEF_RSA_SIG_PROV = "Microsoft RSA Signature Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_DEF_RSA_SCHANNEL_PROV = "Microsoft RSA SChannel Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_DEF_DSS_PROV = "Microsoft Base DSS Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_DEF_DSS_DH_PROV = "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_ENH_DSS_DH_PROV = "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_DEF_DH_SCHANNEL_PROV = "Microsoft DH SChannel Cryptographic Provider";
const LPSTR CAPICOM_PROV_MS_SCARD_PROV = "Microsoft Base Smart Card Crypto Provider";
const LPSTR CAPICOM_PROV_MS_ENH_RSA_AES_PROV = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)";
};
////////////////////////////////////////////////////////////////////////////////
//
// coclass
//
//
// Settings
//
[
uuid(A996E48C-D3DC-4244-89F7-AFA33EC60679),
helpstring("Settings Class")
]
coclass Settings
{
[default] interface ISettings;
};
//
// EKU
//
[
uuid(8535F9A1-738A-40D0-8FB1-10CC8F74E7D3),
helpstring("EKU Class"),
noncreatable
]
coclass EKU
{
[default] interface IEKU;
};
//
// EKUs
//
[
uuid(F1800663-5BFC-4D1A-8D44-56CE02DDA34F),
helpstring("EKUs Class"),
noncreatable
]
coclass EKUs
{
[default] interface IEKUs;
};
//
// KeyUsage
//
[
uuid(9226C95C-38BE-4CC4-B3A2-A867F5199C13),
helpstring("KeyUsage Class"),
noncreatable
]
coclass KeyUsage
{
[default] interface IKeyUsage;
};
//
// Extended key usage
//
[
uuid(42C18607-1B4B-4126-8F1B-76E2DC7F631A),
helpstring("ExtendedKeyUsage Class"),
noncreatable
]
coclass ExtendedKeyUsage
{
[default] interface IExtendedKeyUsage;
};
//
// BasicConstraints
[
uuid(C05AAC6E-3A58-45A9-A203-56952E961E48),
helpstring("BasicConstraints Class"),
noncreatable
]
coclass BasicConstraints
{
[default] interface IBasicConstraints;
};
//
// CertificateStatus
//
[
uuid(16951EE6-A455-47CA-A78B-F98DA566B604),
helpstring("CertificateStatus Class"),
noncreatable
]
coclass CertificateStatus
{
[default] interface ICertificateStatus2;
interface ICertificateStatus;
};
//
// Certificate
//
[
uuid(E38FD381-6404-4041-B5E9-B2739258941F),
helpstring("Certificate Class")
]
coclass Certificate
{
[default] interface ICertificate2;
interface ICertificate;
interface ICertContext;
};
//
// Certificates
//
[
uuid(FBAB033B-CDD0-4C5E-81AB-AEA575CD1338),
helpstring("Certificates Class")
]
coclass Certificates
{
[default] interface ICertificates2;
interface ICertificates;
interface ICCertificates;
};
//
// Chain
//
[
uuid(65104D73-BA60-4160-A95A-4B4782E7AA62),
helpstring("Chain Class")
]
coclass Chain
{
[default] interface IChain2;
interface IChain;
interface IChainContext;
};
//
// Store
//
[
uuid(78E61E52-0E57-4456-A2F2-517492BCBF8F),
helpstring("Store Class")
]
coclass Store
{
[default] interface IStore2;
interface IStore;
interface ICertStore;
};
//
// Attribute
//
[
uuid(54BA1E8F-818D-407F-949D-BAE1692C5C18),
helpstring("Attribute Class")
]
coclass Attribute
{
[default] interface IAttribute;
};
//
// IAttributes
//
[
uuid(933013A9-64C8-4485-ACEF-4908C3692A33),
helpstring("Attributes Class"),
noncreatable
]
coclass Attributes
{
[default] interface IAttributes;
};
//
// Signer
//
[
uuid(60A9863A-11FD-4080-850E-A8E184FC3A3C),
helpstring("Signer Class")
]
coclass Signer
{
[default] interface ISigner2;
interface ISigner;
interface ICSigner;
};
//
// Signers
//
[
uuid(1314C1D8-D3A8-4F8A-BED0-811FD7A8A633),
helpstring("Signers Class"),
noncreatable
]
coclass Signers
{
[default] interface ISigners;
};
//
// SignedData
//
[
uuid(94AFFFCC-6C05-4814-B123-A941105AA77F),
helpstring("SignedData Class")
]
coclass SignedData
{
[default] interface ISignedData;
};
//
// Algorithm
//
[
uuid(A1EEF42F-5026-4A32-BC5C-2E552B70FD96),
helpstring("Algorithm Class"),
noncreatable
]
coclass Algorithm
{
[default] interface IAlgorithm;
};
//
// Recipients
//
[
uuid(96A1B8B0-8F9A-436A-84DE-E23CD6818DA5),
helpstring("Recipients Class"),
noncreatable
]
coclass Recipients
{
[default] interface IRecipients;
};
//
// EnvelopedData
//
[
uuid(F3A12E08-EDE9-4160-8B51-334D982A9AD0),
helpstring("EnvelopedData Class")
]
coclass EnvelopedData
{
[default] interface IEnvelopedData;
};
//
// EncryptedData
//
[
uuid(A440BD76-CFE1-4D46-AB1F-15F238437A3D),
helpstring("EncryptedData Class")
]
coclass EncryptedData
{
[default] interface IEncryptedData;
};
///////////////////////////////////////////////////////////////////////////
//
// CAPICOM v2.0
//
//
// OID
//
[
uuid(7BF3AC5C-CC84-429A-ACA5-74D916AD6B8C),
helpstring("OID Class")
]
coclass OID
{
[default] interface IOID;
};
//
// OIDs
//
[
uuid(FD661131-D716-4D15-A187-AEAAB161C8AD),
helpstring("OIDs Class"),
noncreatable
]
coclass OIDs
{
[default] interface IOIDs;
};
//
// NoticeNumbers
//
[
uuid(A6FDF22A-8E00-464B-B15D-1A891D88B6ED),
helpstring("NoticeNumbers Class"),
noncreatable
]
coclass NoticeNumbers
{
[default] interface INoticeNumbers;
};
//
// Qualifier
//
[
uuid(E5F29B74-0902-4654-8A9A-21C5201DFA61),
helpstring("Qualifier Class"),
noncreatable
]
coclass Qualifier
{
[default] interface IQualifier;
};
//
// Qualifiers
//
[
uuid(6C8006C0-F649-4783-B4A6-617DD0B270C7),
helpstring("Qualifiers Class"),
noncreatable
]
coclass Qualifiers
{
[default] interface IQualifiers;
};
//
// PolicyInformation
//
[
uuid(0AAF88F4-1C22-4F65-A0E3-289D97DCE994),
helpstring("PolicyInformation Class"),
noncreatable
]
coclass PolicyInformation
{
[default] interface IPolicyInformation;
};
//
// CertificatePolicies
//
[
uuid(988583C2-00C7-4D22-9241-E810E35EED1B),
helpstring("CertificatePolicies Class"),
noncreatable
]
coclass CertificatePolicies
{
[default] interface ICertificatePolicies;
};
//
// EncodedData
//
[
uuid(7083C0AA-E7B9-48A4-8EFB-D6A109EBEC13),
helpstring("EncodedData Class"),
noncreatable
]
coclass EncodedData
{
[default] interface IEncodedData;
};
//
// Extension
//
[
uuid(D2359E2C-82D6-458F-BB6F-41559155E693),
helpstring("Extension Class"),
noncreatable
]
coclass Extension
{
[default] interface IExtension;
};
//
// Extensions
//
[
uuid(7C92E131-C1DC-4CA1-B02C-F513A08B41ED),
helpstring("Extensions Class"),
noncreatable
]
coclass Extensions
{
[default] interface IExtensions;
};
//
// ExtendedProperty
//
[
uuid(9E7EA907-5810-4FCA-B817-CD0BBA8496FC),
helpstring("ExtendedProperty Class")
]
coclass ExtendedProperty
{
[default] interface IExtendedProperty;
};
//
// ExtendedProperties
//
[
uuid(90E7143D-1A07-438D-8F85-3DBB0B73D314),
helpstring("ExtendedProperties Class"),
noncreatable
]
coclass ExtendedProperties
{
[default] interface IExtendedProperties;
};
//
// Template
//
[
uuid(61F0D2BD-373E-4F3C-962E-59B7C42C1B22),
helpstring("Template Class"),
noncreatable
]
coclass Template
{
[default] interface ITemplate;
};
//
// PublicKey
//
[
uuid(301FC658-4055-4D76-9703-AA38E6D7236A),
helpstring("PublicKey Class"),
noncreatable
]
coclass PublicKey
{
[default] interface IPublicKey;
};
//
// PrivateKey
//
[
uuid(03ACC284-B757-4B8F-9951-86E600D2CD06),
helpstring("PrivateKey Class")
]
coclass PrivateKey
{
[default] interface IPrivateKey;
interface ICPrivateKey;
};
//
// SignedCode
//
[
uuid(8C3E4934-9FA4-4693-9253-A29A05F99186),
helpstring("SignedCode Class")
]
coclass SignedCode
{
[default] interface ISignedCode;
};
//
// HashedData
//
[
uuid(CE32ABF6-475D-41F6-BF82-D27F03E3D38B),
helpstring("HashedData Class")
]
coclass HashedData
{
[default] interface IHashedData;
};
//
// Utilities
//
[
uuid(22A85CE1-F011-4231-B9E4-7E7A0438F71B),
helpstring("Utilities Class")
]
coclass Utilities
{
[default] interface IUtilities;
};
};
////////////////////////////////////////////////////////////////////////////////
//
// Interfaces
//
//
// Settings
//
[
object,
uuid(A24104F5-46D0-4C0F-926D-665565908E91),
dual,
helpstring("ISettings Interface"),
pointer_default(unique)
]
interface ISettings : IDispatch
{
[propget, id(1), helpstring("Property to get the current setting to enable/disable dialog box to prompt for certificate used to sign/decrypt a message.")]
HRESULT EnablePromptForCertificateUI([out, retval] VARIANT_BOOL * pVal);
[propput, id(1), helpstring("Property to enable/disable dialog box to prompt for certificate used to sign/decrypt a message.")]
HRESULT EnablePromptForCertificateUI([in, defaultvalue(0)] VARIANT_BOOL newVal);
[propget, id(2), helpstring("Property to get the current Active Directory search location.")]
HRESULT ActiveDirectorySearchLocation([out, retval] CAPICOM_ACTIVE_DIRECTORY_SEARCH_LOCATION * pVal);
[propput, id(2), helpstring("Property to set the Active Directory search location. By default, search location is unspecified, in which case Global Catalog will be searched if the userCertificate attribute is published there, otherwise the default domain will be searched.")]
HRESULT ActiveDirectorySearchLocation([in, defaultvalue(CAPICOM_SEARCH_ANY)] CAPICOM_ACTIVE_DIRECTORY_SEARCH_LOCATION newVal);
};
//
// IEKU
//
[
object,
uuid(976B7E6D-1002-4051-BFD4-824A74BD74E2),
dual,
helpstring("IEKU Interface"),
pointer_default(unique)
]
interface IEKU : IDispatch
{
[propget, id(0), helpstring("Default property to get EKU name.")]
HRESULT Name([out, retval] CAPICOM_EKU * pVal);
[propput, id(0), helpstring("Default property to set EKU name.")]
HRESULT Name([in] CAPICOM_EKU newVal);
[propget, id(1), helpstring("Property to get the actual EKU OID string as defined in WinCrypt.h.")]
HRESULT OID([out, retval] BSTR * pVal);
[propput, id(1), helpstring("Property to set the actual EKU OID string as defined in WinCrypt.h.")]
HRESULT OID([in] BSTR newVal);
};
//
// IEKUs
//
[
object,
uuid(47C87CEC-8C4B-4E3C-8D22-34280274EFD1),
dual,
helpstring("IEKUs Interface"),
pointer_default(unique)
]
interface IEKUs : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IKeyUsage
//
[
object,
uuid(41DD35A8-9FF9-45A6-9A7C-F65B2F085D1F),
dual,
helpstring("IKeyUsage Interface"),
pointer_default(unique)
]
interface IKeyUsage : IDispatch
{
//
// Property
//
[propget, id(1), helpstring("Property to check if the KeyUsage extension is present.")]
HRESULT IsPresent([out, retval] VARIANT_BOOL * pVal);
[propget, id(2), helpstring("Property to check if the KeyUsage extension is marked critical.")]
HRESULT IsCritical([out, retval] VARIANT_BOOL * pVal);
[propget, id(3), helpstring("Property to check if the digitalSignature bit is set.")]
HRESULT IsDigitalSignatureEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(4), helpstring("Property to check if the nonRepudiation bit is set.")]
HRESULT IsNonRepudiationEnabled([out, retval] VARIANT_BOOL *pVal);
[propget, id(5), helpstring("Property to check if the keyEncipherment bit is set.")]
HRESULT IsKeyEnciphermentEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(6), helpstring("Property to check if the dataEncipherment bit is set.")]
HRESULT IsDataEnciphermentEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(7), helpstring("Property to check if the keyAgreement bit is set.")]
HRESULT IsKeyAgreementEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(8), helpstring("Property to check if the keyCertSign bit is set.")]
HRESULT IsKeyCertSignEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(9), helpstring("Property to check if the cRLSign bit is set.")]
HRESULT IsCRLSignEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(10), helpstring("Property to check if the encipherOnly bit is set.")]
HRESULT IsEncipherOnlyEnabled([out, retval] VARIANT_BOOL * pVal);
[propget, id(11), helpstring("Property to check if the decipherOnly bit is set.")]
HRESULT IsDecipherOnlyEnabled([out, retval] VARIANT_BOOL * pVal);
};
//
// IExtendedKeyUsage
//
[
object,
uuid(7289D408-987D-45D1-8DEE-CF9E91C2E90E),
dual,
helpstring("IExtendedKeyUsage Interface"),
pointer_default(unique)
]
interface IExtendedKeyUsage : IDispatch
{
//
// Property
//
[propget, id(1), helpstring("Property to check if the EKU extension is present.")]
HRESULT IsPresent([out, retval] VARIANT_BOOL * pVal);
[propget, id(2), helpstring("Property to check if the EKU extension is marked critical.")]
HRESULT IsCritical([out, retval] VARIANT_BOOL * pVal);
[propget, id(3), helpstring("Property to return an EKUs collection object.")]
HRESULT EKUs([out, retval] IEKUs ** pVal);
};
//
// IBasicConstraints
//
[
object,
uuid(4E298C47-ABA6-459E-851B-993D6C626EAD),
dual,
helpstring("IBasicConstraints Interface"),
pointer_default(unique)
]
interface IBasicConstraints : IDispatch
{
[propget, id(1), helpstring("Property to check if the BasicConstraints extension is present.")]
HRESULT IsPresent([out, retval] VARIANT_BOOL * pVal);
[propget, id(2), helpstring("Property to check if the BasicConstraints extension is marked critical.")]
HRESULT IsCritical([out, retval] VARIANT_BOOL * pVal);
[propget, id(3), helpstring("Property to check if it is a certificate authority.")]
HRESULT IsCertificateAuthority([out, retval] VARIANT_BOOL * pVal);
[propget, id(4), helpstring("Property to check if the path length constraint value is present.")]
HRESULT IsPathLenConstraintPresent([out, retval] VARIANT_BOOL * pVal);
[propget, id(5), helpstring("Property to get the path length constraint value.")]
HRESULT PathLenConstraint([out, retval] long * pVal);
};
//
// ICertificateStatus
//
[
object,
uuid(AB769053-6D38-49D4-86EF-5FA85ED3AF27),
dual,
helpstring("ICertificateStatus Interface"),
pointer_default(unique)
]
interface ICertificateStatus : IDispatch
{
[propget, id(0), helpstring("Default property to get the certificate validity result.")]
HRESULT Result([out, retval] VARIANT_BOOL * pVal);
[propget, id(1), helpstring("Property to get validity check flag.")]
HRESULT CheckFlag([out, retval] CAPICOM_CHECK_FLAG * pVal);
[propput, id(1), helpstring("Property to set validity check flag (values can be ORed together and default check flag is CHECK_SIGNATURE_VALIDITY OR CHECK_TIME_VALIDITY OR CHECK_TRUSTED_ROOT).")]
HRESULT CheckFlag([in] CAPICOM_CHECK_FLAG newVal);
[id(2), helpstring("Method to return an IEKU object for setting extended key usage to check (default is no EKU check).")]
HRESULT EKU([out, retval] IEKU ** pVal);
};
//
// ICertificate
//
[
object,
uuid(0BBA0B86-766C-4755-A443-243FF2BD8D29),
dual,
helpstring("ICertificate Interface"),
pointer_default(unique)
]
interface ICertificate : IDispatch
{
//
// Property
//
[propget, id(1), helpstring("Property to get the version number.")]
HRESULT Version([out, retval] long * pVal);
[propget, id(2), helpstring("Property to get the serial number.")]
HRESULT SerialNumber([out, retval] BSTR * pVal);
[propget, id(3), helpstring("Property to get the subject's name.")]
HRESULT SubjectName([out, retval] BSTR * pVal);
[propget, id(4), helpstring("Property to get the issuer's name.")]
HRESULT IssuerName([out, retval] BSTR * pVal);
[propget, id(5), helpstring("Property to get the valid notBefore date.")]
HRESULT ValidFromDate([out, retval] DATE * pVal);
[propget, id(6), helpstring("Property to get the valid notAfter date.")]
HRESULT ValidToDate([out, retval] DATE * pVal);
[propget, id(7), helpstring("Property to get the SHA1 hash.")]
HRESULT Thumbprint([out, retval] BSTR * pVal);
//
// Method
//
[id(10), helpstring("Method to check if private key is available.")]
HRESULT HasPrivateKey([out, retval] VARIANT_BOOL * pVal);
[id(11), helpstring("Method to get other simple information of the certificate.")]
HRESULT GetInfo([in] CAPICOM_CERT_INFO_TYPE InfoType, [out, retval] BSTR * pVal);
[id(12), helpstring("Method to return the ICertificateStatus object for checking if the certificate is valid.")]
HRESULT IsValid([out, retval] ICertificateStatus ** pVal);
[id(13), helpstring("Method to return the KeyUsage object.")]
HRESULT KeyUsage([out, retval] IKeyUsage ** pVal);
[id(14), helpstring("Method to return the ExtendedKeyUsage object.")]
HRESULT ExtendedKeyUsage([out, retval] IExtendedKeyUsage ** pVal);
[id(15), helpstring("Method to return the BasicConstraints object.")]
HRESULT BasicConstraints([out, retval] IBasicConstraints ** pVal);
[id(16), helpstring("Method to export the certificate.")]
HRESULT Export([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(17), helpstring("Method to import a certificate.")]
HRESULT Import([in] BSTR EncodedCertificate);
[id(18), helpstring("Method to display the certificate.")]
HRESULT Display();
};
//
// ICertificates
//
[
object,
uuid(68646716-BDA0-4046-AB82-4444BC93B84A),
dual,
helpstring("ICertificates Interface"),
pointer_default(unique)
]
interface ICertificates : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IChain
//
[
object,
uuid(77F6F881-5D3A-4F2F-AEF0-E4A2F9AA689D),
dual,
helpstring("IChain Interface"),
pointer_default(unique)
]
interface IChain : IDispatch
{
[propget, id(0), helpstring("Default property to get an ordered certificates collection object representing the chain, where Item(1) represents the end certificate and Item(Count()) represents the root certificate.")]
HRESULT Certificates([out, retval] ICertificates ** pVal);
[propget, id(1), helpstring("Property to get validity status of the chain or a particular certficate. For overall chain status, specify Index of 0, otherwise specify the 1 for the end certificate, and Certificates.Count() for the root certificate.")]
HRESULT Status([in, defaultvalue(0)] long Index, [out,retval] long * pVal);
[id(2), helpstring("Method to build the certificate chain and get the overall result of the chain validity.")]
HRESULT Build([in] ICertificate * pICertificate, [out, retval] VARIANT_BOOL * pVal);
};
//
// IStore
//
[
object,
uuid(E860EF75-1B63-4254-AF47-960DAA3DD337),
dual,
helpstring("IStore Interface"),
pointer_default(unique)
]
interface IStore : IDispatch
{
[propget, id(0), helpstring("Default property to get a Certificates collection object.")]
HRESULT Certificates([out, retval] ICertificates ** pVal);
[id(1), helpstring("Method to open a store.")]
HRESULT Open([in, defaultvalue(CAPICOM_CURRENT_USER_STORE)] CAPICOM_STORE_LOCATION StoreLocation,
[in, defaultvalue("My")] BSTR StoreName,
[in, defaultvalue(CAPICOM_STORE_OPEN_READ_ONLY)] CAPICOM_STORE_OPEN_MODE OpenMode);
[id(2), helpstring("Method to add a certificate to the store.")]
HRESULT Add([in] ICertificate * pVal);
[id(3), helpstring("Method to remove a certificate from the store.")]
HRESULT Remove([in] ICertificate * pVal);
[id(4), helpstring("Method to export the store.")]
HRESULT Export([in, defaultvalue(CAPICOM_STORE_SAVE_AS_SERIALIZED)] CAPICOM_STORE_SAVE_AS_TYPE SaveAs,
[in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(5), helpstring("Method to import a store.")]
HRESULT Import([in] BSTR EncodedStore);
};
//
// IAttribute
//
[
object,
uuid(B17A8D78-B5A6-45F7-BA21-01AB94B08415),
dual,
helpstring("IAttribute Interface"),
pointer_default(unique)
]
interface IAttribute : IDispatch
{
[propget, id(0), helpstring("Default property to get attribute name.")]
HRESULT Name([out, retval] CAPICOM_ATTRIBUTE * pVal);
[propput, id(0), helpstring("Default property to set attribute name.")]
HRESULT Name([in] CAPICOM_ATTRIBUTE newVal);
[propget, id(1), helpstring("Property to get attribute value.")]
HRESULT Value([out, retval] VARIANT * pVal);
[propput, id(1), helpstring("Property to set attribute value.")]
HRESULT Value([in] VARIANT newVal);
};
//
// IAttributes
//
[
object,
uuid(6ADC653E-D5B9-422A-991A-A2B0119CEDAC),
dual,
helpstring("IAttributes Interface"),
pointer_default(unique)
]
interface IAttributes : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
[id(2), helpstring("Method Add.")]
HRESULT Add([in] IAttribute * pVal);
[id(3), helpstring("Method Remove.")]
HRESULT Remove([in] long Index);
[id(4), helpstring("Method Clear.")]
HRESULT Clear();
};
//
// ISigner
//
[
object,
uuid(51017B88-1913-49AD-82BE-6BB7C417DCF2),
dual,
helpstring("ISigner Interface"),
pointer_default(unique)
]
interface ISigner : IDispatch
{
[propget, id(0), helpstring("Default property to get signer's certificate.")]
HRESULT Certificate([out, retval] ICertificate ** pVal);
[propput, id(0), helpstring("Default property to set signer's certificate.")]
HRESULT Certificate([in] ICertificate * newVal);
[propget, id(1), helpstring("Property to add/remove authenticated attributes.")]
HRESULT AuthenticatedAttributes([out, retval] IAttributes ** pVal);
};
//
// ISigners
//
[
object,
uuid(5A0780F8-9E6B-4BB0-BF54-87CD9627A8B4),
dual,
helpstring("ISigners Interface"),
pointer_default(unique)
]
interface ISigners : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// ISignedData
//
[
object,
uuid(AE9C454B-FC65-4C10-B130-CD9B45BA948B),
dual,
helpstring("ISignedData Interface"),
pointer_default(unique)
]
interface ISignedData : IDispatch
{
[propput, id(0), helpstring("Default property to set content to be signed.")]
HRESULT Content([in] BSTR newVal);
[propget, id(0), helpstring("Default property to get content to be signed.")]
HRESULT Content([out, retval] BSTR * pVal);
[propget, id(1), helpstring("Property to get all the content signers as an ISigners collection object.")]
HRESULT Signers([out, retval] ISigners ** pVal);
[propget, id(2), helpstring("Property to get all certificates in the signed message.")]
HRESULT Certificates([out, retval] ICertificates ** pVal);
[id(3), helpstring("Method to sign the message.")]
HRESULT Sign([in, defaultvalue(NULL)] ISigner * pSigner,
[in, defaultvalue(0)] VARIANT_BOOL bDetached,
[in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(4), helpstring("Method to CoSign the message.")]
HRESULT CoSign([in, defaultvalue(NULL)] ISigner * pSigner,
[in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(5), helpstring("Method to verify if signature(s) in the signed message is cryptographically valid.")]
HRESULT Verify([in] BSTR SignedMessage,
[in, defaultvalue(0)] VARIANT_BOOL bDetached,
[in, defaultvalue(CAPICOM_VERIFY_SIGNATURE_AND_CERTIFICATE)] CAPICOM_SIGNED_DATA_VERIFY_FLAG VerifyFlag);
};
//
// IAlgorithm
//
[
object,
uuid(BF3D04A9-B0DA-4153-B45E-6CCFA5AC715B),
dual,
helpstring("IAlgorithm Interface"),
pointer_default(unique)
]
interface IAlgorithm : IDispatch
{
[propget, id(0), helpstring("Default property to get encryption algorithm.")]
HRESULT Name([out, retval] CAPICOM_ENCRYPTION_ALGORITHM * pVal);
[propput, id(0), helpstring("Default property to set encryption algorithm.")]
HRESULT Name([in] CAPICOM_ENCRYPTION_ALGORITHM newVal);
[propget, id(1), helpstring("Property to get encryption key length. This property is ignored for DES or 3DES.")]
HRESULT KeyLength([out, retval] CAPICOM_ENCRYPTION_KEY_LENGTH * pVal);
[propput, id(1), helpstring("Property to set encryption key length. This property is ignored for DES or 3DES.")]
HRESULT KeyLength([in] CAPICOM_ENCRYPTION_KEY_LENGTH newVal);
};
//
// Recipients
//
[
object,
uuid(A694C896-FC38-4C34-AE61-3B1A95984C14),
dual,
helpstring("IRecipients Interface"),
pointer_default(unique)
]
interface IRecipients : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
[id(2), helpstring("Method Add.")]
HRESULT Add([in] ICertificate * pVal);
[id(3), helpstring("Method Remove.")]
HRESULT Remove([in] long Index);
[id(4), helpstring("Method Clear.")]
HRESULT Clear();
};
//
// IEnvelopedData
//
[
object,
uuid(F6CB6A20-CC18-4424-AE57-6F2AA3DC2059),
dual,
helpstring("IEnvelopedData Interface"),
pointer_default(unique)
]
interface IEnvelopedData : IDispatch
{
[propput, id(0), helpstring("Default property to set the content to be enveloped.")]
HRESULT Content([in] BSTR newVal);
[propget, id(0), helpstring("Default property to get the content to be enveloped.")]
HRESULT Content([out, retval] BSTR * pVal);
[propget, id(1), helpstring("Property to get/set the encryption algorithm.")]
HRESULT Algorithm([out, retval] IAlgorithm ** pVal);
[propget, id(2), helpstring("Property to add/remove recipients.")]
HRESULT Recipients([out, retval] IRecipients ** pVal);
[id(3), helpstring("Method to envelop the content.")]
HRESULT Encrypt([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(4), helpstring("Method to decrypt the enveloped content.")]
HRESULT Decrypt([in] BSTR EnvelopedMessage);
};
//
// IEncryptedData
//
[
object,
uuid(C4778A66-972F-42E4-87C5-5CC16F7931CA),
dual,
helpstring("IEncryptedData Interface"),
pointer_default(unique)
]
interface IEncryptedData : IDispatch
{
[propput, id(0), helpstring("Default property to set the content to be encrypted.")]
HRESULT Content([in] BSTR newVal);
[propget, id(0), helpstring("Default property to get the content to be encrypted.")]
HRESULT Content([out, retval] BSTR * pVal);
[propget, id(1), helpstring("Property to get/set the encryption algorithm.")]
HRESULT Algorithm([out, retval] IAlgorithm ** pVal);
[id(2), helpstring("Method to set the secret used to generate the symmetric key.")]
HRESULT SetSecret([in] BSTR newVal,
[in, defaultvalue(CAPICOM_SECRET_PASSWORD)] CAPICOM_SECRET_TYPE SecretType);
[id(3), helpstring("Method to encrypt the content.")]
HRESULT Encrypt([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(4), helpstring("Method to decrypt the encrypted content.")]
HRESULT Decrypt([in] BSTR EncryptedMessage);
};
////////////////////////////////////////////////////////////////////////////////
//
// CAPICOM v2.0
//
//
// IOID
//
[
object,
uuid(208E5E9B-58B1-4086-970F-161B582A846F),
dual,
helpstring("IOID Interface"),
pointer_default(unique)
]
interface IOID : IDispatch
{
[propget, id(0), helpstring("Default property to get name.")]
HRESULT Name([out, retval] CAPICOM_OID * pVal);
[propput, id(0), helpstring("Default property to set name.")]
HRESULT Name([in] CAPICOM_OID newVal);
[propget, id(1), helpstring("Default property to get friendly name.")]
HRESULT FriendlyName([out, retval] BSTR * pVal);
[propput, id(1), helpstring("Default property to set friendly name.")]
HRESULT FriendlyName([in] BSTR newVal);
[propget, id(2), helpstring("Property to get the OID string value as defined in WinCrypt.h.")]
HRESULT Value([out, retval] BSTR * pVal);
[propput, id(2), helpstring("Property to set the OID string value as defined in WinCrypt.h.")]
HRESULT Value([in] BSTR newVal);
};
//
// IOID
//
[
object,
uuid(DA55E8FC-8E27-451B-AEA8-1470D80FAD42),
dual,
helpstring("IOIDs Interface"),
pointer_default(unique)
]
interface IOIDs : IDispatch
{
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] VARIANT Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
[id(2), helpstring("Method Add.")]
HRESULT Add([in] IOID * pVal);
[id(3), helpstring("Method Remove.")]
HRESULT Remove([in] VARIANT Index);
[id(4), helpstring("Method Clear.")]
HRESULT Clear();
};
//
// INoticeNumbers
//
[
object,
uuid(EE2C051D-33A1-4157-86B4-9280E29782F2),
dual,
helpstring("INoticeNumbers Interface"),
pointer_default(unique)
]
interface INoticeNumbers : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IQualifier
//
[
object,
uuid(3604C9DD-A22E-4A15-A469-8181C0C113DE),
dual,
helpstring("IQualifier Interface"),
pointer_default(unique)
]
interface IQualifier : IDispatch
{
[propget, id(0), helpstring("Default property to get the OID.")]
HRESULT OID([out, retval] IOID ** pVal);
[propget, id(1), helpstring("Property to get the URI for the Certificate Practice Statement (CPS).")]
HRESULT CPSPointer([out, retval] BSTR * pVal);
[propget, id(2), helpstring("Property to get the organization name.")]
HRESULT OrganizationName([out, retval] BSTR * pVal);
[propget, id(3), helpstring("Property to get the notice numbers.")]
HRESULT NoticeNumbers([out, retval] INoticeNumbers ** pVal);
[propget, id(4), helpstring("Property to get the explicit text.")]
HRESULT ExplicitText([out, retval] BSTR * pVal);
};
//
// IQualifiers
//
[
object,
uuid(6B5A8AB6-597D-4398-AC63-1036EF546348),
dual,
helpstring("IQualifiers Interface"),
pointer_default(unique)
]
interface IQualifiers : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IPolicyInformation
//
[
object,
uuid(8973710C-8411-4951-9E65-D45FD524FFDF),
dual,
helpstring("IPolicyInformation Interface"),
pointer_default(unique)
]
interface IPolicyInformation : IDispatch
{
[propget, id(0), helpstring("Default property to get the OID.")]
HRESULT OID([out, retval] IOID ** pVal);
[propget, id(1), helpstring("Property to get the qualifiers collection object.")]
HRESULT Qualifiers([out, retval] IQualifiers ** pVal);
};
//
// ICertificatePolicies
//
[
object,
uuid(CC7A72A7-C83A-4049-85F4-4292DE9DBFD3),
dual,
helpstring("ICertificatePolicies Interface"),
pointer_default(unique)
]
interface ICertificatePolicies : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IEncodedData
//
[
object,
uuid(D3D460F2-E7F3-4AF3-8EC6-8EB68C61C567),
dual,
helpstring("IEncodedData Interface"),
pointer_default(unique)
]
interface IEncodedData : IDispatch
{
[propget, id(0), helpstring("Default property to get the encoded data.")]
HRESULT Value([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(1), helpstring("Method to format the encoded data for display purpose.")]
HRESULT Format([in, defaultvalue(0)] VARIANT_BOOL bMultiLines,
[out, retval] BSTR * pVal);
[id(2), helpstring("Method to return the decoder object (IDispatch), which can be NULL.")]
HRESULT Decoder([out, retval] IDispatch ** pVal);
};
//
// IExtension
//
[
object,
uuid(ED4E4ED4-FDD8-476E-AED9-5239E7948257),
dual,
helpstring("IExtension Interface"),
pointer_default(unique)
]
interface IExtension : IDispatch
{
[propget, id(0), helpstring("Default property to get the IOID object.")]
HRESULT OID([out, retval] IOID ** pVal);
[propget, id(1), helpstring("Property to get IsCritical setting.")]
HRESULT IsCritical([out, retval] VARIANT_BOOL * pVal);
[propget, id(2), helpstring("Property to get the EncodedData object.")]
HRESULT EncodedData([out, retval] IEncodedData ** pVal);
};
//
// IExtensions
//
[
object,
uuid(BC530D61-E692-4225-9E7A-07B90B45856A),
dual,
helpstring("IExtensions Interface"),
pointer_default(unique)
]
interface IExtensions : IDispatch
{
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] VARIANT Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
};
//
// IExtendedProperty
//
[
object,
uuid(ECB8A5C8-562C-4989-B49D-FA37D40F8FC4),
dual,
helpstring("IExtendedProperty Interface"),
pointer_default(unique)
]
interface IExtendedProperty : IDispatch
{
[propget, id(0), helpstring("Default property to get PropID.")]
HRESULT PropID([out, retval] CAPICOM_PROPID * pVal);
[propput, id(0), helpstring("Default property to set PropID.")]
HRESULT PropID([in] CAPICOM_PROPID newVal);
[propget, id(1), helpstring("Property to get the extended property data.")]
HRESULT Value([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[propput, id(1), helpstring("Property to set the extended property data.")]
HRESULT Value([in, defaultvalue(CAPICOM_ENCODE_BASE64)] CAPICOM_ENCODING_TYPE EncodingType,
[in] BSTR newVal);
};
//
// IExtendedProperties
//
[
object,
uuid(3B096E87-6218-4A3B-A880-F6CB951E7805),
dual,
helpstring("IExtendedProperties Interface"),
pointer_default(unique)
]
interface IExtendedProperties : IDispatch
{
//
// Property
//
[propget, id(0), helpstring("Property Item.")]
HRESULT Item([in] long Index, [out, retval] VARIANT * pVal);
[propget, id(1), helpstring("Property Count.")]
HRESULT Count([out, retval] long * pVal);
[propget, id(DISPID_NEWENUM), helpstring("Property _NewEnum."), restricted]
HRESULT _NewEnum([out, retval] LPUNKNOWN * pVal);
[id(2), helpstring("Method Add.")]
HRESULT Add([in] IExtendedProperty * pVal);
[id(3), helpstring("Method Remove.")]
HRESULT Remove([in] CAPICOM_PROPID PropId);
};
//
// ITemplate
//
[
object,
uuid(5F10FFCE-C922-476F-AA76-DF99D5BDFA2C),
dual,
helpstring("ITemplate Interface"),
pointer_default(unique)
]
interface ITemplate : IDispatch
{
//
// Property
//
[propget, id(1), helpstring("Property to check if the CertificateTemplate extension is present.")]
HRESULT IsPresent([out, retval] VARIANT_BOOL * pVal);
[propget, id(2), helpstring("Property to check if the CertificateTemplate extension is marked critical.")]
HRESULT IsCritical([out, retval] VARIANT_BOOL * pVal);
[propget, id(3), helpstring("Property to get the name of the CertificateTemplate extension.")]
HRESULT Name([out, retval] BSTR * pVal);
[propget, id(4), helpstring("Property to get the OID object.")]
HRESULT OID([out, retval] IOID ** pVal);
[propget, id(5), helpstring("Property to get the major version number.")]
HRESULT MajorVersion([out, retval] long * pVal);
[propget, id(6), helpstring("Property to get the minor version number.")]
HRESULT MinorVersion([out, retval] long * pVal);
};
//
// IPublicKey
//
[
object,
uuid(72BF9ADA-6817-4C31-B43E-25F7C7B091F4),
dual,
helpstring("IPublicKey Interface"),
pointer_default(unique)
]
interface IPublicKey : IDispatch
{
[propget, id(0), helpstring("Default property to get the algorithm OID object.")]
HRESULT Algorithm([out, retval] IOID ** pVal);
[propget, id(1), helpstring("Property to get key length.")]
HRESULT Length([out, retval] long * pVal);
[propget, id(2), helpstring("Property to get the EncodedData object for the key.")]
HRESULT EncodedKey([out, retval] IEncodedData ** pVal);
[propget, id(3), helpstring("Property to get the EncodedData object for the parameters.")]
HRESULT EncodedParameters([out, retval] IEncodedData ** pVal);
};
//
// IPrivateKey
//
[
object,
uuid(659DEDC3-6C85-42DB-8527-EFCB21742862),
dual,
helpstring("IPrivateKey Interface"),
pointer_default(unique)
]
interface IPrivateKey : IDispatch
{
[propget, id(0), helpstring("Default property to get the key container name.")]
HRESULT ContainerName([out, retval] BSTR * pVal);
[propget, id(1), helpstring("Property to get the unique key container name.")]
HRESULT UniqueContainerName([out, retval] BSTR * pVal);
[propget, id(2), helpstring("Property to get the provider name.")]
HRESULT ProviderName([out, retval] BSTR * pVal);
[propget, id(3), helpstring("Property to get the provider type.")]
HRESULT ProviderType([out, retval] CAPICOM_PROV_TYPE * pVal);
[propget, id(4), helpstring("Property to get the key spec value.")]
HRESULT KeySpec([out, retval] CAPICOM_KEY_SPEC * pVal);
[id(5), helpstring("Method to check if the key is accessible.")]
HRESULT IsAccessible([out, retval] VARIANT_BOOL * pVal);
[id(6), helpstring("Method to check if the key is protected.")]
HRESULT IsProtected([out, retval] VARIANT_BOOL * pVal);
[id(7), helpstring("Method to check if the key is marked exportable.")]
HRESULT IsExportable([out, retval] VARIANT_BOOL * pVal);
[id(8), helpstring("Method to check if the key is in removable storage.")]
HRESULT IsRemovable([out, retval] VARIANT_BOOL * pVal);
[id(9), helpstring("Method to check if the key is a machine keyset.")]
HRESULT IsMachineKeyset([out, retval] VARIANT_BOOL * pVal);
[id(10), helpstring("Method to check if the key is stored in hardware device.")]
HRESULT IsHardwareDevice([out, retval] VARIANT_BOOL * pVal);
[id(11), helpstring("Method to open an existing key container.")]
HRESULT Open([in] BSTR ContainerName,
[in, defaultvalue("Microsoft Enhanced Cryptographic Provider v1.0")] BSTR ProviderName,
[in, defaultvalue(CAPICOM_PROV_RSA_FULL)] CAPICOM_PROV_TYPE ProviderType,
[in, defaultvalue(CAPICOM_KEY_SPEC_SIGNATURE)] CAPICOM_KEY_SPEC KeySpec,
[in, defaultvalue(CAPICOM_CURRENT_USER_STORE)] CAPICOM_STORE_LOCATION StoreLocation,
[in, defaultvalue(0)] VARIANT_BOOL bCheckExistence);
[id(12), helpstring("Method to delete the existing key container.")]
HRESULT Delete();
};
//
// ICertificateStatus2
//
[
object,
uuid(BF95660E-F743-4EAC-9DE5-960787A4606C),
dual,
helpstring("ICertificateStatus2 Interface"),
pointer_default(unique)
]
interface ICertificateStatus2 : ICertificateStatus
{
[propget, id(3), helpstring("Property to get verification time.")]
HRESULT VerificationTime([out, retval] DATE * pVal);
[propput, id(3), helpstring("Property to set verification time.")]
HRESULT VerificationTime([in] DATE newVal);
[propget, id(4), helpstring("Property to get the URL retrieval timeout value (in seconds).")]
HRESULT UrlRetrievalTimeout([out, retval] long * pVal);
[propput, id(4), helpstring("Property to set the URL retrieval timeout value (in seconds).")]
HRESULT UrlRetrievalTimeout([in] long newVal);
[id(5), helpstring("Method to get the certificate policies OIDs collection.")]
HRESULT CertificatePolicies([out, retval] IOIDs ** pVal);
[id(6), helpstring("Method to get the application policies OIDs collection.")]
HRESULT ApplicationPolicies([out, retval] IOIDs ** pVal);
};
//
// ICertificate2
//
[
object,
uuid(6FE450DC-AD32-48d4-A366-01EE7E0B1374),
dual,
helpstring("ICertificate2 Interface"),
pointer_default(unique)
]
interface ICertificate2 : ICertificate
{
[propget, id(19), helpstring("Property to get archived status.")]
HRESULT Archived([out, retval] VARIANT_BOOL * pVal);
[propput, id(19), helpstring("Property to set the archived status.")]
HRESULT Archived([in] VARIANT_BOOL newVal);
[id(20), helpstring("Method to return the Template object.")]
HRESULT Template([out, retval] ITemplate ** pVal);
[id(21), helpstring("Method to return the PublicKey object.")]
HRESULT PublicKey([out, retval] IPublicKey ** pVal);
[propget, id(22), helpstring("Property to get the PrivateKey object.")]
HRESULT PrivateKey([out, retval] IPrivateKey ** pVal);
[propput, id(22), helpstring("Property to set the PrivateKey object (NULL to disassociate).")]
HRESULT PrivateKey([in] IPrivateKey * newVal);
[id(23), helpstring("Method to return the Extensions object.")]
HRESULT Extensions([out, retval] IExtensions ** pVal);
[id(24), helpstring("Method to return the ExtendedProperties object.")]
HRESULT ExtendedProperties([out, retval] IExtendedProperties ** pVal);
[id(25), helpstring("Method to load a certificate from file.")]
HRESULT Load([in] BSTR FileName,
[in, defaultvalue("")] BSTR Password,
[in, defaultvalue(CAPICOM_KEY_STORAGE_DEFAULT)] CAPICOM_KEY_STORAGE_FLAG KeyStorageFlag,
[in, defaultvalue(CAPICOM_CURRENT_USER_KEY)] CAPICOM_KEY_LOCATION KeyLocation);
[id(26), helpstring("Method to save a certificate to file, with option to include the chain for PFX file.")]
HRESULT Save([in] BSTR FileName,
[in, defaultvalue("")] BSTR Password,
[in, defaultvalue(CAPICOM_CERTIFICATE_SAVE_AS_CER)] CAPICOM_CERTIFICATE_SAVE_AS_TYPE SaveAs,
[in, defaultvalue(CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)] CAPICOM_CERTIFICATE_INCLUDE_OPTION IncludeOption);
};
//
// ICertificates2
//
[
object,
uuid(7B57C04B-1786-4B30-A7B6-36235CD58A14),
dual,
helpstring("ICertificates2 Interface"),
pointer_default(unique)
]
interface ICertificates2 : ICertificates
{
[id(2), helpstring("Method to find certificates in the collection.")]
HRESULT Find([in] CAPICOM_CERTIFICATE_FIND_TYPE FindType,
[in, defaultvalue(0)] VARIANT varCriteria,
[in, defaultvalue(0)] VARIANT_BOOL bFindValidOnly,
[out, retval] ICertificates2 ** pVal);
[id(3), helpstring("Method to display the certificate selection dialog box.")]
HRESULT Select([in, defaultvalue("")] BSTR Title,
[in, defaultvalue("")] BSTR DisplayString,
[in, defaultvalue(0)] VARIANT_BOOL bMultiSelect,
[out, retval] ICertificates2 ** pVal);
[id(4), helpstring("Method to add a certificate to the collection.")]
HRESULT Add([in] ICertificate2 * pVal);
[id(5), helpstring("Method to remove a certificate in the collection.")]
HRESULT Remove([in] VARIANT Index);
[id(6), helpstring("Method to remove all certificates in the collection.")]
HRESULT Clear();
[id(7), helpstring("Method to save certificate collection to file.")]
HRESULT Save([in] BSTR FileName,
[in, defaultvalue("")] BSTR Password,
[in, defaultvalue(CAPICOM_CERTIFICATES_SAVE_AS_PFX)] CAPICOM_CERTIFICATES_SAVE_AS_TYPE SaveAs,
[in, defaultvalue(CAPICOM_EXPORT_DEFAULT)] CAPICOM_EXPORT_FLAG ExportFlag);
};
//
// IChain2
//
[
object,
uuid(CA65D842-2110-4073-AEE3-D0AA5F56C421),
dual,
helpstring("IChain2 Interface"),
pointer_default(unique)
]
interface IChain2 : IChain
{
[id(3), helpstring("Method to get the certificate policies OIDs collection.")]
HRESULT CertificatePolicies([out, retval] IOIDs ** pVal);
[id(4), helpstring("Method to get the application policies OIDs collection.")]
HRESULT ApplicationPolicies([out, retval] IOIDs ** pVal);
[id(5), helpstring("Method to get the extended error information description string.")]
HRESULT ExtendedErrorInfo([in, defaultvalue(1)] long Index,
[out, retval] BSTR * pVal);
#if (0) //DSIE: Made this C++ method.
[id(6), helpstring("Method to verify the chain with specified check flags.")]
HRESULT Verify ([in, defaultvalue(CAPICOM_CHECK_OFFLINE_ALL)] CAPICOM_CHECK_FLAG CheckFlag,
[out, retval] CAPICOM_CHAIN_STATUS * pVal);
#endif
};
//
// IStore2
//
[
object,
uuid(4DA6ABC4-BDCD-4317-B650-262075B93A9C),
dual,
helpstring("IStore2 Interface"),
pointer_default(unique)
]
interface IStore2 : IStore
{
[id(6), helpstring("Method to load certificate(s) from file.")]
HRESULT Load([in] BSTR FileName,
[in, defaultvalue("")] BSTR Password,
[in, defaultvalue(CAPICOM_KEY_STORAGE_DEFAULT)] CAPICOM_KEY_STORAGE_FLAG KeyStorageFlag);
};
//
// ISigner2
//
[
object,
uuid(625B1F55-C720-41D6-9ECF-BA59F9B85F17),
dual,
helpstring("ISigner2 Interface"),
pointer_default(unique)
]
interface ISigner2 : ISigner
{
[propget, id(2), helpstring("Property to get signer's chain.")]
HRESULT Chain([out, retval] IChain ** pVal);
[propget, id(3), helpstring("Property to get signer options.")]
HRESULT Options([out, retval] CAPICOM_CERTIFICATE_INCLUDE_OPTION * pVal);
[propput, id(3), helpstring("Property to set signer options.")]
HRESULT Options([in, defaultvalue(CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT)] CAPICOM_CERTIFICATE_INCLUDE_OPTION newVal);
[id(4), helpstring("Method to load signing certificate from a PFX file.")]
HRESULT Load([in] BSTR FileName,
[in, defaultvalue("")] BSTR Password);
};
//
// SignedCode
//
[
object,
uuid(84FBCB95-5600-404C-9187-AC25B4CD6E94),
dual,
helpstring("ISignedCode Interface"),
pointer_default(unique)
]
interface ISignedCode : IDispatch
{
[propget, id(0), helpstring("Default property to get the filename of code to be signed.")]
HRESULT FileName([out, retval] BSTR * pVal);
[propput, id(0), helpstring("Default property to set the filename of code to be signed.")]
HRESULT FileName([in] BSTR newVal);
[propget, id(1), helpstring("Property to get the description text.")]
HRESULT Description([out, retval] BSTR * pVal);
[propput, id(1), helpstring("Property to set the description text.")]
HRESULT Description([in] BSTR newVal);
[propget, id(2), helpstring("Property to get the description URL.")]
HRESULT DescriptionURL([out, retval] BSTR * pVal);
[propput, id(2), helpstring("Property to set the description URL.")]
HRESULT DescriptionURL([in] BSTR newVal);
[propget, id(3), helpstring("Property to get the signer.")]
HRESULT Signer([out, retval] ISigner2 ** pVal);
[propget, id(4), helpstring("Property to get the time stamper.")]
HRESULT TimeStamper([out, retval] ISigner2 ** pVal);
[propget, id(5), helpstring("Property to get all certificates in the signed code.")]
HRESULT Certificates([out, retval] ICertificates2 ** pVal);
[id(6), helpstring("Method to sign the code.")]
HRESULT Sign([in, defaultvalue(NULL)] ISigner2 * pISigner2);
[id(7), helpstring("Method to timestamp the signed code.")]
HRESULT Timestamp([in] BSTR URL);
[id(8), helpstring("Method to verify the signed code.")]
HRESULT Verify([in, defaultvalue(0)] VARIANT_BOOL bUIAllowed);
};
//
// IHashedData
//
[
object,
uuid(9F7F23E8-06F4-42E8-B965-5CBD044BF27F),
dual,
helpstring("IHashedData Interface"),
pointer_default(unique)
]
interface IHashedData : IDispatch
{
[propget, id(0), helpstring("Default property to get hashed value in hex format. Once the hashed value is obtained, future call to the Hash method starts a new hash.")]
HRESULT Value([out, retval] BSTR * pVal);
[propget, id(1), helpstring("Property to get hashing algorithm.")]
HRESULT Algorithm([out, retval] CAPICOM_HASH_ALGORITHM * pVal);
[propput, id(1), helpstring("Property to set hashing algorithm")]
HRESULT Algorithm([in] CAPICOM_HASH_ALGORITHM newVal);
[id(2), helpstring("Method to hash data. Must repeatedly call this method until all data are hashed, then the hashed value can be obtained through the Value property.")]
HRESULT Hash([in] BSTR newVal);
};
//
// IUtilities
//
[
object,
uuid(EB166CF6-2AE6-44DA-BD96-0C1635D183FE),
dual,
helpstring("IUtilities Interface"),
pointer_default(unique)
]
interface IUtilities : IDispatch
{
[id(1), helpstring("Method to get a secure random number.")]
HRESULT GetRandom([in, defaultvalue(8)] long Length,
[in, defaultvalue(CAPICOM_ENCODE_BINARY)] CAPICOM_ENCODING_TYPE EncodingType,
[out, retval] BSTR * pVal);
[id(2), helpstring("Method to Base64 encode a string.")]
HRESULT Base64Encode([in] BSTR SrcString,
[out, retval] BSTR * pVal);
[id(3), helpstring("Method to Base64 decode a string.")]
HRESULT Base64Decode([in] BSTR EncodedString,
[out, retval] BSTR * pVal);
[id(4), helpstring("Method to convert a binary packed string to hex string.")]
HRESULT BinaryToHex([in] BSTR BinaryString,
[out, retval] BSTR * pVal);
[id(5), helpstring("Method to convert a hex string to binary packed string.")]
HRESULT HexToBinary([in] BSTR HexString,
[out, retval] BSTR * pVal);
[id(6), helpstring("Method to convert binary packed string to an array of bytes (VT_ARRAY | VT_UI1).")]
HRESULT BinaryStringToByteArray([in] BSTR BinaryString,
[out,retval] VARIANT * pVal);
[id(7), helpstring("Method to convert an array of bytes (VT_ARRAY | VT_UI1) to binary packed string.")]
HRESULT ByteArrayToBinaryString([in] VARIANT varByteArray,
[out,retval] BSTR * pVal);
[id(8), helpstring("Method to convert local time to UTC time.")]
HRESULT LocalTimeToUTCTime([in] DATE LocalTime,
[out, retval] DATE * pVal);
[id(9), helpstring("Method to convert UTC time to local time.")]
HRESULT UTCTimeToLocalTime([in] DATE UTCTime,
[out, retval] DATE * pVal);
};
////////////////////////////////////////////////////////////////////////////////
//
// Custom interfaces.
//
//
// ICertContext
//
[
object,
uuid(9E7D3477-4F63-423E-8A45-E13B2BB851A2),
local,
helpstring("ICertContext Interface"),
pointer_default(unique)
]
interface ICertContext : IUnknown
{
[propget, helpstring("Poperty to get PCCERT_CONTEXT of the certificate which is represented as a long. Note that you MUST call either the FreeContext method or CAPI's CertFreeCertificateContext() function, to free the context.")]
HRESULT CertContext([out, retval] long * ppCertContext);
[propput, helpstring("Property to set PCCERT_CONTEXT. Note that setting this property will reset the entire Certificate object.")]
HRESULT CertContext([in] long pCertContext);
[helpstring("Method to free a PCCERT_CONTEXT. Note that this method does not free the PCCERT_CONTEXT contained within the Certificate object. It is intended for freeing context acquired through the CertContext property.")]
HRESULT FreeContext([in] long pCertContext);
}
//
// IChainContext
//
[
object,
uuid(B27FFB30-432E-4585-A3FD-72530108CBFD),
local,
helpstring("IChainContext Interface"),
pointer_default(unique)
]
interface IChainContext : IUnknown
{
[propget, helpstring("Property to get PCCERT_CHAIN_CONTEXT of the certificate chain which is represented as a long. Note that you MUST call either the FreeContext method or CAPI's CertFreeCertificateChain() function to free the context.")]
HRESULT ChainContext([out, retval] long * pChainContext);
[propput, helpstring("Poperty to set PCCERT_CHAIN_CONTEXT. Note that setting this property will reset the entire Chain object.")]
HRESULT ChainContext([in] long pChainContext);
[helpstring("Method to free a PCCERT_CHAIN_CONTEXT. Note that this method does not free the PCCERT_CHAIN_CONTEXT contained within the Chain object. It is intended for freeing context acquired through the ChainContext property.")]
HRESULT FreeContext([in] long pChainContext);
}
//
// ICertStore
//
[
object,
uuid(BB3ECB9C-A83A-445c-BDB5-EFBEF691B731),
local,
helpstring("ICertStore Interface"),
pointer_default(unique)
]
interface ICertStore : IUnknown
{
[propget, helpstring("Property to get HCERTSTORE of the certificate store which is represented as a long. Note that you MUST call either the CloseHandle method or CAPI's CertCloseStore() function to close the handle.")]
HRESULT StoreHandle([out, retval] long * phCertStore);
[propput, helpstring("Property to set HCERTSTORE. Note that setting this property will reset the entire Store object.")]
HRESULT StoreHandle([in] long hCertStore);
[propget, helpstring("Property to get CAPICOM_STORE_LOCATION of the certificate store.")]
HRESULT StoreLocation([out, retval] CAPICOM_STORE_LOCATION * pStoreLocation);
[propput, helpstring("Property to set CAPICOM_STORE_LOCATION.")]
HRESULT StoreLocation([in] CAPICOM_STORE_LOCATION StoreLocation);
[helpstring("Method to close a HCERTSTORE. Note that this method does not close the HCERTSTORE contained within the Store object. It is intended for closing handle acquired through the StoreHandle property.")]
HRESULT CloseHandle([in] long hCertStore);
}
//
// ICSigner
//
[
object,
uuid(8F83F792-014C-4E22-BD57-5C381E622F34),
local,
restricted,
helpstring("ICSigner Interface"),
pointer_default(unique)
]
interface ICSigner : IUnknown
{
[propget, helpstring("Property to get HCERSTORE of the additional certificate store which is represented as a long.")]
HRESULT AdditionalStore([out, retval] long * phAdditionalStore);
[propput, helpstring("Property to set the additional certificate store handle.")]
HRESULT AdditionalStore([in] long hAdditionalStore);
}
////////////////////////////////////////////////////////////////////////////////
//
// Restricted custom interfaces.
//
//
// ICCertificates
//
[
object,
uuid(EBDC6DC2-684D-4425-BBB7-CB4D15A088A7),
local,
restricted,
helpstring("ICCertificates Interface"),
pointer_default(unique)
]
interface ICCertificates : IUnknown
{
[restricted] HRESULT _ExportToStore([in] HCERTSTORE hCertStore);
}
//
// ICPrivateKey
//
[
object,
uuid(50F241B7-A8F2-4e0a-B982-4BD7DF0CCF3C),
local,
restricted,
helpstring("ICPrivateKey Interface"),
pointer_default(unique)
]
interface ICPrivateKey : IUnknown
{
[restricted] HRESULT _GetKeyProvInfo([out, retval] PCRYPT_KEY_PROV_INFO * pKeyProvInfo);
}