WinCrypt.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:634k
- BOOL fInhibitPolicyMapping;
- DWORD dwInhibitPolicyMappingSkipCerts;
- } CERT_POLICY_CONSTRAINTS_INFO, *PCERT_POLICY_CONSTRAINTS_INFO;
- //+-------------------------------------------------------------------------
- // RSA_CSP_PUBLICKEYBLOB
- //
- // pvStructInfo points to a PUBLICKEYSTRUC immediately followed by a
- // RSAPUBKEY and the modulus bytes.
- //
- // CryptExportKey outputs the above StructInfo for a dwBlobType of
- // PUBLICKEYBLOB. CryptImportKey expects the above StructInfo when
- // importing a public key.
- //
- // For dwCertEncodingType = X509_ASN_ENCODING, the RSA_CSP_PUBLICKEYBLOB is
- // encoded as a PKCS #1 RSAPublicKey consisting of a SEQUENCE of a
- // modulus INTEGER and a publicExponent INTEGER. The modulus is encoded
- // as being a unsigned integer. When decoded, if the modulus was encoded
- // as unsigned integer with a leading 0 byte, the 0 byte is removed before
- // converting to the CSP modulus bytes.
- //
- // For decode, the aiKeyAlg field of PUBLICKEYSTRUC is always set to
- // CALG_RSA_KEYX.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_KEYGEN_REQUEST_TO_BE_SIGNED
- //
- // pvStructInfo points to CERT_KEYGEN_REQUEST_INFO.
- //
- // For CryptDecodeObject(), the pbEncoded is the "to be signed" plus its
- // signature (output of a X509_CERT CryptEncodeObject()).
- //
- // For CryptEncodeObject(), the pbEncoded is just the "to be signed".
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // PKCS_ATTRIBUTE data structure
- //
- // pvStructInfo points to a CRYPT_ATTRIBUTE.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // PKCS_ATTRIBUTES data structure
- //
- // pvStructInfo points to a CRYPT_ATTRIBUTES.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // PKCS_CONTENT_INFO_SEQUENCE_OF_ANY data structure
- //
- // pvStructInfo points to following CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY.
- //
- // For X509_ASN_ENCODING: encoded as a PKCS#7 ContentInfo structure wrapping
- // a sequence of ANY. The value of the contentType field is pszObjId,
- // while the content field is the following structure:
- // SequenceOfAny ::= SEQUENCE OF ANY
- //
- // The CRYPT_DER_BLOBs point to the already encoded ANY content.
- //--------------------------------------------------------------------------
- typedef struct _CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY {
- LPSTR pszObjId;
- DWORD cValue;
- PCRYPT_DER_BLOB rgValue;
- } CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY, *PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY;
- //+-------------------------------------------------------------------------
- // PKCS_CONTENT_INFO data structure
- //
- // pvStructInfo points to following CRYPT_CONTENT_INFO.
- //
- // For X509_ASN_ENCODING: encoded as a PKCS#7 ContentInfo structure.
- // The CRYPT_DER_BLOB points to the already encoded ANY content.
- //--------------------------------------------------------------------------
- typedef struct _CRYPT_CONTENT_INFO {
- LPSTR pszObjId;
- CRYPT_DER_BLOB Content;
- } CRYPT_CONTENT_INFO, *PCRYPT_CONTENT_INFO;
- //+-------------------------------------------------------------------------
- // X509_OCTET_STRING data structure
- //
- // pvStructInfo points to a CRYPT_DATA_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_BITS data structure
- //
- // pvStructInfo points to a CRYPT_BIT_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_BITS_WITHOUT_TRAILING_ZEROES data structure
- //
- // pvStructInfo points to a CRYPT_BIT_BLOB.
- //
- // The same as X509_BITS, except before encoding, the bit length is
- // decremented to exclude trailing zero bits.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_INTEGER data structure
- //
- // pvStructInfo points to an int.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_MULTI_BYTE_INTEGER data structure
- //
- // pvStructInfo points to a CRYPT_INTEGER_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_ENUMERATED data structure
- //
- // pvStructInfo points to an int containing the enumerated value
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_CHOICE_OF_TIME data structure
- //
- // pvStructInfo points to a FILETIME.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_SEQUENCE_OF_ANY data structure
- //
- // pvStructInfo points to following CRYPT_SEQUENCE_OF_ANY.
- //
- // The CRYPT_DER_BLOBs point to the already encoded ANY content.
- //--------------------------------------------------------------------------
- typedef struct _CRYPT_SEQUENCE_OF_ANY {
- DWORD cValue;
- PCRYPT_DER_BLOB rgValue;
- } CRYPT_SEQUENCE_OF_ANY, *PCRYPT_SEQUENCE_OF_ANY;
- //+-------------------------------------------------------------------------
- // X509_AUTHORITY_KEY_ID2
- // szOID_AUTHORITY_KEY_IDENTIFIER2
- //
- // pvStructInfo points to following CERT_AUTHORITY_KEY_ID2_INFO.
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_AUTHORITY_KEY_ID2)
- //
- // See X509_ALTERNATE_NAME for error location defines.
- //--------------------------------------------------------------------------
- typedef struct _CERT_AUTHORITY_KEY_ID2_INFO {
- CRYPT_DATA_BLOB KeyId;
- CERT_ALT_NAME_INFO AuthorityCertIssuer; // Optional, set cAltEntry
- // to 0 to omit.
- CRYPT_INTEGER_BLOB AuthorityCertSerialNumber;
- } CERT_AUTHORITY_KEY_ID2_INFO, *PCERT_AUTHORITY_KEY_ID2_INFO;
- //+-------------------------------------------------------------------------
- // szOID_SUBJECT_KEY_IDENTIFIER
- //
- // pvStructInfo points to a CRYPT_DATA_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_AUTHORITY_INFO_ACCESS
- // szOID_AUTHORITY_INFO_ACCESS
- //
- // pvStructInfo points to following CERT_AUTHORITY_INFO_ACCESS.
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_AUTHORITY_INFO_ACCESS)
- //
- // Error location consists of:
- // ENTRY_INDEX - 8 bits << 16
- // VALUE_INDEX - 16 bits (unicode character index)
- //
- // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
- // defines.
- //--------------------------------------------------------------------------
- typedef struct _CERT_ACCESS_DESCRIPTION {
- LPSTR pszAccessMethod; // pszObjId
- CERT_ALT_NAME_ENTRY AccessLocation;
- } CERT_ACCESS_DESCRIPTION, *PCERT_ACCESS_DESCRIPTION;
- typedef struct _CERT_AUTHORITY_INFO_ACCESS {
- DWORD cAccDescr;
- PCERT_ACCESS_DESCRIPTION rgAccDescr;
- } CERT_AUTHORITY_INFO_ACCESS, *PCERT_AUTHORITY_INFO_ACCESS;
- //+-------------------------------------------------------------------------
- // PKIX Access Description: Access Method Object Identifiers
- //--------------------------------------------------------------------------
- #define szOID_PKIX_ACC_DESCR "1.3.6.1.5.5.7.48"
- #define szOID_PKIX_OCSP "1.3.6.1.5.5.7.48.1"
- #define szOID_PKIX_CA_ISSUERS "1.3.6.1.5.5.7.48.2"
- //+-------------------------------------------------------------------------
- // X509_CRL_REASON_CODE
- // szOID_CRL_REASON_CODE
- //
- // pvStructInfo points to an int which can be set to one of the following
- // enumerated values:
- //--------------------------------------------------------------------------
- #define CRL_REASON_UNSPECIFIED 0
- #define CRL_REASON_KEY_COMPROMISE 1
- #define CRL_REASON_CA_COMPROMISE 2
- #define CRL_REASON_AFFILIATION_CHANGED 3
- #define CRL_REASON_SUPERSEDED 4
- #define CRL_REASON_CESSATION_OF_OPERATION 5
- #define CRL_REASON_CERTIFICATE_HOLD 6
- #define CRL_REASON_REMOVE_FROM_CRL 8
- //+-------------------------------------------------------------------------
- // X509_CRL_DIST_POINTS
- // szOID_CRL_DIST_POINTS
- //
- // pvStructInfo points to following CRL_DIST_POINTS_INFO.
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_CRL_DIST_POINTS)
- //
- // Error location consists of:
- // CRL_ISSUER_BIT - 1 bit << 31 (0 for FullName, 1 for CRLIssuer)
- // POINT_INDEX - 7 bits << 24
- // ENTRY_INDEX - 8 bits << 16
- // VALUE_INDEX - 16 bits (unicode character index)
- //
- // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
- // defines.
- //--------------------------------------------------------------------------
- typedef struct _CRL_DIST_POINT_NAME {
- DWORD dwDistPointNameChoice;
- union {
- CERT_ALT_NAME_INFO FullName; // 1
- // Not implemented IssuerRDN; // 2
- };
- } CRL_DIST_POINT_NAME, *PCRL_DIST_POINT_NAME;
- #define CRL_DIST_POINT_NO_NAME 0
- #define CRL_DIST_POINT_FULL_NAME 1
- #define CRL_DIST_POINT_ISSUER_RDN_NAME 2
- typedef struct _CRL_DIST_POINT {
- CRL_DIST_POINT_NAME DistPointName; // OPTIONAL
- CRYPT_BIT_BLOB ReasonFlags; // OPTIONAL
- CERT_ALT_NAME_INFO CRLIssuer; // OPTIONAL
- } CRL_DIST_POINT, *PCRL_DIST_POINT;
- #define CRL_REASON_UNUSED_FLAG 0x80
- #define CRL_REASON_KEY_COMPROMISE_FLAG 0x40
- #define CRL_REASON_CA_COMPROMISE_FLAG 0x20
- #define CRL_REASON_AFFILIATION_CHANGED_FLAG 0x10
- #define CRL_REASON_SUPERSEDED_FLAG 0x08
- #define CRL_REASON_CESSATION_OF_OPERATION_FLAG 0x04
- #define CRL_REASON_CERTIFICATE_HOLD_FLAG 0x02
- typedef struct _CRL_DIST_POINTS_INFO {
- DWORD cDistPoint;
- PCRL_DIST_POINT rgDistPoint;
- } CRL_DIST_POINTS_INFO, *PCRL_DIST_POINTS_INFO;
- #define CRL_DIST_POINT_ERR_INDEX_MASK 0x7F
- #define CRL_DIST_POINT_ERR_INDEX_SHIFT 24
- #define GET_CRL_DIST_POINT_ERR_INDEX(X)
- ((X >> CRL_DIST_POINT_ERR_INDEX_SHIFT) & CRL_DIST_POINT_ERR_INDEX_MASK)
- #define CRL_DIST_POINT_ERR_CRL_ISSUER_BIT 0x80000000L
- #define IS_CRL_DIST_POINT_ERR_CRL_ISSUER(X)
- (0 != (X & CRL_DIST_POINT_ERR_CRL_ISSUER_BIT))
- //+-------------------------------------------------------------------------
- // X509_CROSS_CERT_DIST_POINTS
- // szOID_CROSS_CERT_DIST_POINTS
- //
- // pvStructInfo points to following CROSS_CERT_DIST_POINTS_INFO.
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_CRL_DIST_POINTS)
- //
- // Error location consists of:
- // POINT_INDEX - 8 bits << 24
- // ENTRY_INDEX - 8 bits << 16
- // VALUE_INDEX - 16 bits (unicode character index)
- //
- // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
- // defines.
- //--------------------------------------------------------------------------
- typedef struct _CROSS_CERT_DIST_POINTS_INFO {
- // Seconds between syncs. 0 implies use client default.
- DWORD dwSyncDeltaTime;
- DWORD cDistPoint;
- PCERT_ALT_NAME_INFO rgDistPoint;
- } CROSS_CERT_DIST_POINTS_INFO, *PCROSS_CERT_DIST_POINTS_INFO;
- #define CROSS_CERT_DIST_POINT_ERR_INDEX_MASK 0xFF
- #define CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT 24
- #define GET_CROSS_CERT_DIST_POINT_ERR_INDEX(X)
- ((X >> CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT) &
- CROSS_CERT_DIST_POINT_ERR_INDEX_MASK)
- //+-------------------------------------------------------------------------
- // X509_ENHANCED_KEY_USAGE
- // szOID_ENHANCED_KEY_USAGE
- //
- // pvStructInfo points to a CERT_ENHKEY_USAGE, CTL_USAGE.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_CERT_PAIR
- //
- // pvStructInfo points to the following CERT_PAIR.
- //--------------------------------------------------------------------------
- typedef struct _CERT_PAIR {
- CERT_BLOB Forward; // OPTIONAL, if Forward.cbData == 0, omitted
- CERT_BLOB Reverse; // OPTIONAL, if Reverse.cbData == 0, omitted
- } CERT_PAIR, *PCERT_PAIR;
- //+-------------------------------------------------------------------------
- // szOID_CRL_NUMBER
- //
- // pvStructInfo points to an int.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_DELTA_CRL_INDICATOR
- //
- // pvStructInfo points to an int.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_ISSUING_DIST_POINT
- // X509_ISSUING_DIST_POINT
- //
- // pvStructInfo points to the following CRL_ISSUING_DIST_POINT.
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_ISSUING_DIST_POINT)
- //
- // Error location consists of:
- // ENTRY_INDEX - 8 bits << 16
- // VALUE_INDEX - 16 bits (unicode character index)
- //
- // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
- // defines.
- //--------------------------------------------------------------------------
- typedef struct _CRL_ISSUING_DIST_POINT {
- CRL_DIST_POINT_NAME DistPointName; // OPTIONAL
- BOOL fOnlyContainsUserCerts;
- BOOL fOnlyContainsCACerts;
- CRYPT_BIT_BLOB OnlySomeReasonFlags; // OPTIONAL
- BOOL fIndirectCRL;
- } CRL_ISSUING_DIST_POINT, *PCRL_ISSUING_DIST_POINT;
- //+-------------------------------------------------------------------------
- // szOID_FRESHEST_CRL
- //
- // pvStructInfo points to CRL_DIST_POINTS_INFO.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NAME_CONSTRAINTS
- // X509_NAME_CONSTRAINTS
- //
- // pvStructInfo points to the following CERT_NAME_CONSTRAINTS_INFO
- //
- // For CRYPT_E_INVALID_IA5_STRING, the error location is returned in
- // *pcbEncoded by CryptEncodeObject(X509_NAME_CONSTRAINTS)
- //
- // Error location consists of:
- // EXCLUDED_SUBTREE_BIT - 1 bit << 31 (0 for permitted, 1 for excluded)
- // ENTRY_INDEX - 8 bits << 16
- // VALUE_INDEX - 16 bits (unicode character index)
- //
- // See X509_ALTERNATE_NAME for ENTRY_INDEX and VALUE_INDEX error location
- // defines.
- //--------------------------------------------------------------------------
- typedef struct _CERT_GENERAL_SUBTREE {
- CERT_ALT_NAME_ENTRY Base;
- DWORD dwMinimum;
- BOOL fMaximum;
- DWORD dwMaximum;
- } CERT_GENERAL_SUBTREE, *PCERT_GENERAL_SUBTREE;
- typedef struct _CERT_NAME_CONSTRAINTS_INFO {
- DWORD cPermittedSubtree;
- PCERT_GENERAL_SUBTREE rgPermittedSubtree;
- DWORD cExcludedSubtree;
- PCERT_GENERAL_SUBTREE rgExcludedSubtree;
- } CERT_NAME_CONSTRAINTS_INFO, *PCERT_NAME_CONSTRAINTS_INFO;
- #define CERT_EXCLUDED_SUBTREE_BIT 0x80000000L
- #define IS_CERT_EXCLUDED_SUBTREE(X)
- (0 != (X & CERT_EXCLUDED_SUBTREE_BIT))
- //+-------------------------------------------------------------------------
- // szOID_NEXT_UPDATE_LOCATION
- //
- // pvStructInfo points to a CERT_ALT_NAME_INFO.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_REMOVE_CERTIFICATE
- //
- // pvStructInfo points to an int which can be set to one of the following
- // 0 - Add certificate
- // 1 - Remove certificate
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // PKCS_CTL
- // szOID_CTL
- //
- // pvStructInfo points to a CTL_INFO.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // PKCS_SORTED_CTL
- //
- // pvStructInfo points to a CTL_INFO.
- //
- // Same as for PKCS_CTL, except, the CTL entries are sorted. The following
- // extension containing the sort information is inserted as the first
- // extension in the encoded CTL.
- //
- // Only supported for Encoding. CRYPT_ENCODE_ALLOC_FLAG flag must be
- // set.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // Sorted CTL TrustedSubjects extension
- //
- // Array of little endian DWORDs:
- // [0] - Flags
- // [1] - Count of HashBucket entry offsets
- // [2] - Maximum HashBucket entry collision count
- // [3 ..] (Count + 1) HashBucket entry offsets
- //
- // When this extension is present in the CTL,
- // the ASN.1 encoded sequence of TrustedSubjects are HashBucket ordered.
- //
- // The entry offsets point to the start of the first encoded TrustedSubject
- // sequence for the HashBucket. The encoded TrustedSubjects for a HashBucket
- // continue until the encoded offset of the next HashBucket. A HashBucket has
- // no entries if HashBucket[N] == HashBucket[N + 1].
- //
- // The HashBucket offsets are from the start of the ASN.1 encoded CTL_INFO.
- //--------------------------------------------------------------------------
- #define SORTED_CTL_EXT_FLAGS_OFFSET (0*4)
- #define SORTED_CTL_EXT_COUNT_OFFSET (1*4)
- #define SORTED_CTL_EXT_MAX_COLLISION_OFFSET (2*4)
- #define SORTED_CTL_EXT_HASH_BUCKET_OFFSET (3*4)
- // If the SubjectIdentifiers are a MD5 or SHA1 hash, the following flag is
- // set. When set, the first 4 bytes of the SubjectIdentifier are used as
- // the dwhash. Otherwise, the SubjectIdentifier bytes are hashed into dwHash.
- // In either case the HashBucket index = dwHash % cHashBucket.
- #define SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG 0x1
- //+-------------------------------------------------------------------------
- // X509_MULTI_BYTE_UINT
- //
- // pvStructInfo points to a CRYPT_UINT_BLOB. Before encoding, inserts a
- // leading 0x00. After decoding, removes a leading 0x00.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_DSS_PUBLICKEY
- //
- // pvStructInfo points to a CRYPT_UINT_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_DSS_PARAMETERS
- //
- // pvStructInfo points to following CERT_DSS_PARAMETERS data structure.
- //--------------------------------------------------------------------------
- typedef struct _CERT_DSS_PARAMETERS {
- CRYPT_UINT_BLOB p;
- CRYPT_UINT_BLOB q;
- CRYPT_UINT_BLOB g;
- } CERT_DSS_PARAMETERS, *PCERT_DSS_PARAMETERS;
- //+-------------------------------------------------------------------------
- // X509_DSS_SIGNATURE
- //
- // pvStructInfo is a BYTE rgbSignature[CERT_DSS_SIGNATURE_LEN]. The
- // bytes are ordered as output by the DSS CSP's CryptSignHash().
- //--------------------------------------------------------------------------
- #define CERT_DSS_R_LEN 20
- #define CERT_DSS_S_LEN 20
- #define CERT_DSS_SIGNATURE_LEN (CERT_DSS_R_LEN + CERT_DSS_S_LEN)
- // Sequence of 2 unsigned integers (the extra +1 is for a potential leading
- // 0x00 to make the integer unsigned)
- #define CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN (2 + 2*(2 + 20 +1))
- //+-------------------------------------------------------------------------
- // X509_DH_PUBLICKEY
- //
- // pvStructInfo points to a CRYPT_UINT_BLOB.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // X509_DH_PARAMETERS
- //
- // pvStructInfo points to following CERT_DH_PARAMETERS data structure.
- //--------------------------------------------------------------------------
- typedef struct _CERT_DH_PARAMETERS {
- CRYPT_UINT_BLOB p;
- CRYPT_UINT_BLOB g;
- } CERT_DH_PARAMETERS, *PCERT_DH_PARAMETERS;
- //+-------------------------------------------------------------------------
- // X942_DH_PARAMETERS
- //
- // pvStructInfo points to following CERT_X942_DH_PARAMETERS data structure.
- //
- // If q.cbData == 0, then, the following fields are zero'ed.
- //--------------------------------------------------------------------------
- typedef struct _CERT_X942_DH_VALIDATION_PARAMS {
- CRYPT_BIT_BLOB seed;
- DWORD pgenCounter;
- } CERT_X942_DH_VALIDATION_PARAMS, *PCERT_X942_DH_VALIDATION_PARAMS;
- typedef struct _CERT_X942_DH_PARAMETERS {
- CRYPT_UINT_BLOB p; // odd prime, p = jq + 1
- CRYPT_UINT_BLOB g; // generator, g
- CRYPT_UINT_BLOB q; // factor of p - 1, OPTIONAL
- CRYPT_UINT_BLOB j; // subgroup factor, OPTIONAL
- PCERT_X942_DH_VALIDATION_PARAMS pValidationParams; // OPTIONAL
- } CERT_X942_DH_PARAMETERS, *PCERT_X942_DH_PARAMETERS;
- //+-------------------------------------------------------------------------
- // X942_OTHER_INFO
- //
- // pvStructInfo points to following CRYPT_X942_OTHER_INFO data structure.
- //
- // rgbCounter and rgbKeyLength are in Little Endian order.
- //--------------------------------------------------------------------------
- #define CRYPT_X942_COUNTER_BYTE_LENGTH 4
- #define CRYPT_X942_KEY_LENGTH_BYTE_LENGTH 4
- #define CRYPT_X942_PUB_INFO_BYTE_LENGTH (512/8)
- typedef struct _CRYPT_X942_OTHER_INFO {
- LPSTR pszContentEncryptionObjId;
- BYTE rgbCounter[CRYPT_X942_COUNTER_BYTE_LENGTH];
- BYTE rgbKeyLength[CRYPT_X942_KEY_LENGTH_BYTE_LENGTH];
- CRYPT_DATA_BLOB PubInfo; // OPTIONAL
- } CRYPT_X942_OTHER_INFO, *PCRYPT_X942_OTHER_INFO;
- //+-------------------------------------------------------------------------
- // PKCS_RC2_CBC_PARAMETERS
- // szOID_RSA_RC2CBC
- //
- // pvStructInfo points to following CRYPT_RC2_CBC_PARAMETERS data structure.
- //--------------------------------------------------------------------------
- typedef struct _CRYPT_RC2_CBC_PARAMETERS {
- DWORD dwVersion;
- BOOL fIV; // set if has following IV
- BYTE rgbIV[8];
- } CRYPT_RC2_CBC_PARAMETERS, *PCRYPT_RC2_CBC_PARAMETERS;
- #define CRYPT_RC2_40BIT_VERSION 160
- #define CRYPT_RC2_56BIT_VERSION 52
- #define CRYPT_RC2_64BIT_VERSION 120
- #define CRYPT_RC2_128BIT_VERSION 58
- //+-------------------------------------------------------------------------
- // PKCS_SMIME_CAPABILITIES
- // szOID_RSA_SMIMECapabilities
- //
- // pvStructInfo points to following CRYPT_SMIME_CAPABILITIES data structure.
- //
- // Note, for CryptEncodeObject(X509_ASN_ENCODING), Parameters.cbData == 0
- // causes the encoded parameters to be omitted and not encoded as a NULL
- // (05 00) as is done when encoding a CRYPT_ALGORITHM_IDENTIFIER. This
- // is per the SMIME specification for encoding capabilities.
- //--------------------------------------------------------------------------
- typedef struct _CRYPT_SMIME_CAPABILITY {
- LPSTR pszObjId;
- CRYPT_OBJID_BLOB Parameters;
- } CRYPT_SMIME_CAPABILITY, *PCRYPT_SMIME_CAPABILITY;
- typedef struct _CRYPT_SMIME_CAPABILITIES {
- DWORD cCapability;
- PCRYPT_SMIME_CAPABILITY rgCapability;
- } CRYPT_SMIME_CAPABILITIES, *PCRYPT_SMIME_CAPABILITIES;
- //+-------------------------------------------------------------------------
- // PKCS7_SIGNER_INFO
- //
- // pvStructInfo points to CMSG_SIGNER_INFO.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // CMS_SIGNER_INFO
- //
- // pvStructInfo points to CMSG_CMS_SIGNER_INFO.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // Verisign Certificate Extension Object Identifiers
- //--------------------------------------------------------------------------
- // Octet String containing Boolean
- #define szOID_VERISIGN_PRIVATE_6_9 "2.16.840.1.113733.1.6.9"
- // Octet String containing IA5 string: lower case 32 char hex string
- #define szOID_VERISIGN_ONSITE_JURISDICTION_HASH "2.16.840.1.113733.1.6.11"
- // Octet String containing Bit string
- #define szOID_VERISIGN_BITSTRING_6_13 "2.16.840.1.113733.1.6.13"
- // EKU
- #define szOID_VERISIGN_ISS_STRONG_CRYPTO "2.16.840.1.113733.1.8.1"
- //+-------------------------------------------------------------------------
- // Netscape Certificate Extension Object Identifiers
- //--------------------------------------------------------------------------
- #define szOID_NETSCAPE "2.16.840.1.113730"
- #define szOID_NETSCAPE_CERT_EXTENSION "2.16.840.1.113730.1"
- #define szOID_NETSCAPE_CERT_TYPE "2.16.840.1.113730.1.1"
- #define szOID_NETSCAPE_BASE_URL "2.16.840.1.113730.1.2"
- #define szOID_NETSCAPE_REVOCATION_URL "2.16.840.1.113730.1.3"
- #define szOID_NETSCAPE_CA_REVOCATION_URL "2.16.840.1.113730.1.4"
- #define szOID_NETSCAPE_CERT_RENEWAL_URL "2.16.840.1.113730.1.7"
- #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8"
- #define szOID_NETSCAPE_SSL_SERVER_NAME "2.16.840.1.113730.1.12"
- #define szOID_NETSCAPE_COMMENT "2.16.840.1.113730.1.13"
- //+-------------------------------------------------------------------------
- // Netscape Certificate Data Type Object Identifiers
- //--------------------------------------------------------------------------
- #define szOID_NETSCAPE_DATA_TYPE "2.16.840.1.113730.2"
- #define szOID_NETSCAPE_CERT_SEQUENCE "2.16.840.1.113730.2.5"
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_CERT_TYPE extension
- //
- // Its value is a bit string. CryptDecodeObject/CryptEncodeObject using
- // X509_BITS or X509_BITS_WITHOUT_TRAILING_ZEROES.
- //
- // The following bits are defined:
- //--------------------------------------------------------------------------
- #define NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE 0x80
- #define NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE 0x40
- #define NETSCAPE_SMIME_CERT_TYPE 0x20
- #define NETSCAPE_SIGN_CERT_TYPE 0x10
- #define NETSCAPE_SSL_CA_CERT_TYPE 0x04
- #define NETSCAPE_SMIME_CA_CERT_TYPE 0x02
- #define NETSCAPE_SIGN_CA_CERT_TYPE 0x01
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_BASE_URL extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // When present this string is added to the beginning of all relative URLs
- // in the certificate. This extension can be considered an optimization
- // to reduce the size of the URL extensions.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_REVOCATION_URL extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a relative or absolute URL that can be used to check the
- // revocation status of a certificate. The revocation check will be
- // performed as an HTTP GET method using a url that is the concatenation of
- // revocation-url and certificate-serial-number.
- // Where the certificate-serial-number is encoded as a string of
- // ascii hexadecimal digits. For example, if the netscape-base-url is
- // https://www.certs-r-us.com/, the netscape-revocation-url is
- // cgi-bin/check-rev.cgi?, and the certificate serial number is 173420,
- // the resulting URL would be:
- // https://www.certs-r-us.com/cgi-bin/check-rev.cgi?02a56c
- //
- // The server should return a document with a Content-Type of
- // application/x-netscape-revocation. The document should contain
- // a single ascii digit, '1' if the certificate is not curently valid,
- // and '0' if it is curently valid.
- //
- // Note: for all of the URLs that include the certificate serial number,
- // the serial number will be encoded as a string which consists of an even
- // number of hexadecimal digits. If the number of significant digits is odd,
- // the string will have a single leading zero to ensure an even number of
- // digits is generated.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_CA_REVOCATION_URL extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a relative or absolute URL that can be used to check the
- // revocation status of any certificates that are signed by the CA that
- // this certificate belongs to. This extension is only valid in CA
- // certificates. The use of this extension is the same as the above
- // szOID_NETSCAPE_REVOCATION_URL extension.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_CERT_RENEWAL_URL extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a relative or absolute URL that points to a certificate renewal
- // form. The renewal form will be accessed with an HTTP GET method using a
- // url that is the concatenation of renewal-url and
- // certificate-serial-number. Where the certificate-serial-number is
- // encoded as a string of ascii hexadecimal digits. For example, if the
- // netscape-base-url is https://www.certs-r-us.com/, the
- // netscape-cert-renewal-url is cgi-bin/check-renew.cgi?, and the
- // certificate serial number is 173420, the resulting URL would be:
- // https://www.certs-r-us.com/cgi-bin/check-renew.cgi?02a56c
- // The document returned should be an HTML form that will allow the user
- // to request a renewal of their certificate.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_CA_POLICY_URL extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a relative or absolute URL that points to a web page that
- // describes the policies under which the certificate was issued.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_SSL_SERVER_NAME extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a "shell expression" that can be used to match the hostname of the
- // SSL server that is using this certificate. It is recommended that if
- // the server's hostname does not match this pattern the user be notified
- // and given the option to terminate the SSL connection. If this extension
- // is not present then the CommonName in the certificate subject's
- // distinguished name is used for the same purpose.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_COMMENT extension
- //
- // Its value is an IA5_STRING. CryptDecodeObject/CryptEncodeObject using
- // X509_ANY_STRING or X509_UNICODE_ANY_STRING, where,
- // dwValueType = CERT_RDN_IA5_STRING.
- //
- // It is a comment that may be displayed to the user when the certificate
- // is viewed.
- //--------------------------------------------------------------------------
- //+-------------------------------------------------------------------------
- // szOID_NETSCAPE_CERT_SEQUENCE
- //
- // Its value is a PKCS#7 ContentInfo structure wrapping a sequence of
- // certificates. The value of the contentType field is
- // szOID_NETSCAPE_CERT_SEQUENCE, while the content field is the following
- // structure:
- // CertificateSequence ::= SEQUENCE OF Certificate.
- //
- // CryptDecodeObject/CryptEncodeObject using
- // PKCS_CONTENT_INFO_SEQUENCE_OF_ANY, where,
- // pszObjId = szOID_NETSCAPE_CERT_SEQUENCE and the CRYPT_DER_BLOBs point
- // to encoded X509 certificates.
- //--------------------------------------------------------------------------
- //+=========================================================================
- // Certificate Management Messages over CMS (CMC) Data Structures
- //==========================================================================
- // Content Type (request)
- #define szOID_CT_PKI_DATA "1.3.6.1.5.5.7.12.2"
- // Content Type (response)
- #define szOID_CT_PKI_RESPONSE "1.3.6.1.5.5.7.12.3"
- // Signature value that only contains the hash octets. The parameters for
- // this algorithm must be present and must be encoded as NULL.
- #define szOID_PKIX_NO_SIGNATURE "1.3.6.1.5.5.7.6.2"
- #define szOID_CMC "1.3.6.1.5.5.7.7"
- #define szOID_CMC_STATUS_INFO "1.3.6.1.5.5.7.7.1"
- #define szOID_CMC_IDENTIFICATION "1.3.6.1.5.5.7.7.2"
- #define szOID_CMC_IDENTITY_PROOF "1.3.6.1.5.5.7.7.3"
- #define szOID_CMC_DATA_RETURN "1.3.6.1.5.5.7.7.4"
- // Transaction Id (integer)
- #define szOID_CMC_TRANSACTION_ID "1.3.6.1.5.5.7.7.5"
- // Sender Nonce (octet string)
- #define szOID_CMC_SENDER_NONCE "1.3.6.1.5.5.7.7.6"
- // Recipient Nonce (octet string)
- #define szOID_CMC_RECIPIENT_NONCE "1.3.6.1.5.5.7.7.7"
- #define szOID_CMC_ADD_EXTENSIONS "1.3.6.1.5.5.7.7.8"
- #define szOID_CMC_ENCRYPTED_POP "1.3.6.1.5.5.7.7.9"
- #define szOID_CMC_DECRYPTED_POP "1.3.6.1.5.5.7.7.10"
- #define szOID_CMC_LRA_POP_WITNESS "1.3.6.1.5.5.7.7.11"
- // Issuer Name + Serial
- #define szOID_CMC_GET_CERT "1.3.6.1.5.5.7.7.15"
- // Issuer Name [+ CRL Name] + Time [+ Reasons]
- #define szOID_CMC_GET_CRL "1.3.6.1.5.5.7.7.16"
- // Issuer Name + Serial [+ Reason] [+ Effective Time] [+ Secret] [+ Comment]
- #define szOID_CMC_REVOKE_REQUEST "1.3.6.1.5.5.7.7.17"
- // (octet string) URL-style parameter list (IA5?)
- #define szOID_CMC_REG_INFO "1.3.6.1.5.5.7.7.18"
- #define szOID_CMC_RESPONSE_INFO "1.3.6.1.5.5.7.7.19"
- // (octet string)
- #define szOID_CMC_QUERY_PENDING "1.3.6.1.5.5.7.7.21"
- #define szOID_CMC_ID_POP_LINK_RANDOM "1.3.6.1.5.5.7.7.22"
- #define szOID_CMC_ID_POP_LINK_WITNESS "1.3.6.1.5.5.7.7.23"
- // optional Name + Integer
- #define szOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE "1.3.6.1.5.5.7.7.24"
- #define szOID_CMC_ADD_ATTRIBUTES "1.3.6.1.4.1.311.10.10.1"
- //+-------------------------------------------------------------------------
- // CMC_DATA
- // CMC_RESPONSE
- //
- // Certificate Management Messages over CMS (CMC) PKIData and Response
- // messages.
- //
- // For CMC_DATA, pvStructInfo points to a CMC_DATA_INFO.
- // CMC_DATA_INFO contains optional arrays of tagged attributes, requests,
- // content info and/or arbitrary other messages.
- //
- // For CMC_RESPONSE, pvStructInfo points to a CMC_RESPONSE_INFO.
- // CMC_RESPONSE_INFO is the same as CMC_DATA_INFO without the tagged
- // requests.
- //--------------------------------------------------------------------------
- typedef struct _CMC_TAGGED_ATTRIBUTE {
- DWORD dwBodyPartID;
- CRYPT_ATTRIBUTE Attribute;
- } CMC_TAGGED_ATTRIBUTE, *PCMC_TAGGED_ATTRIBUTE;
- typedef struct _CMC_TAGGED_CERT_REQUEST {
- DWORD dwBodyPartID;
- CRYPT_DER_BLOB SignedCertRequest;
- } CMC_TAGGED_CERT_REQUEST, *PCMC_TAGGED_CERT_REQUEST;
- typedef struct _CMC_TAGGED_REQUEST {
- DWORD dwTaggedRequestChoice;
- union {
- // CMC_TAGGED_CERT_REQUEST_CHOICE
- PCMC_TAGGED_CERT_REQUEST pTaggedCertRequest;
- };
- } CMC_TAGGED_REQUEST, *PCMC_TAGGED_REQUEST;
- #define CMC_TAGGED_CERT_REQUEST_CHOICE 1
- typedef struct _CMC_TAGGED_CONTENT_INFO {
- DWORD dwBodyPartID;
- CRYPT_DER_BLOB EncodedContentInfo;
- } CMC_TAGGED_CONTENT_INFO, *PCMC_TAGGED_CONTENT_INFO;
- typedef struct _CMC_TAGGED_OTHER_MSG {
- DWORD dwBodyPartID;
- LPSTR pszObjId;
- CRYPT_OBJID_BLOB Value;
- } CMC_TAGGED_OTHER_MSG, *PCMC_TAGGED_OTHER_MSG;
- // All the tagged arrays are optional
- typedef struct _CMC_DATA_INFO {
- DWORD cTaggedAttribute;
- PCMC_TAGGED_ATTRIBUTE rgTaggedAttribute;
- DWORD cTaggedRequest;
- PCMC_TAGGED_REQUEST rgTaggedRequest;
- DWORD cTaggedContentInfo;
- PCMC_TAGGED_CONTENT_INFO rgTaggedContentInfo;
- DWORD cTaggedOtherMsg;
- PCMC_TAGGED_OTHER_MSG rgTaggedOtherMsg;
- } CMC_DATA_INFO, *PCMC_DATA_INFO;
- // All the tagged arrays are optional
- typedef struct _CMC_RESPONSE_INFO {
- DWORD cTaggedAttribute;
- PCMC_TAGGED_ATTRIBUTE rgTaggedAttribute;
- DWORD cTaggedContentInfo;
- PCMC_TAGGED_CONTENT_INFO rgTaggedContentInfo;
- DWORD cTaggedOtherMsg;
- PCMC_TAGGED_OTHER_MSG rgTaggedOtherMsg;
- } CMC_RESPONSE_INFO, *PCMC_RESPONSE_INFO;
- //+-------------------------------------------------------------------------
- // CMC_STATUS
- //
- // Certificate Management Messages over CMS (CMC) Status.
- //
- // pvStructInfo points to a CMC_STATUS_INFO.
- //--------------------------------------------------------------------------
- typedef struct _CMC_PEND_INFO {
- CRYPT_DATA_BLOB PendToken;
- FILETIME PendTime;
- } CMC_PEND_INFO, *PCMC_PEND_INFO;
- typedef struct _CMC_STATUS_INFO {
- DWORD dwStatus;
- DWORD cBodyList;
- DWORD *rgdwBodyList;
- LPWSTR pwszStatusString; // OPTIONAL
- DWORD dwOtherInfoChoice;
- union {
- // CMC_OTHER_INFO_NO_CHOICE
- // none
- // CMC_OTHER_INFO_FAIL_CHOICE
- DWORD dwFailInfo;
- // CMC_OTHER_INFO_PEND_CHOICE
- PCMC_PEND_INFO pPendInfo;
- };
- } CMC_STATUS_INFO, *PCMC_STATUS_INFO;
- #define CMC_OTHER_INFO_NO_CHOICE 0
- #define CMC_OTHER_INFO_FAIL_CHOICE 1
- #define CMC_OTHER_INFO_PEND_CHOICE 2
- //
- // dwStatus values
- //
- // Request was granted
- #define CMC_STATUS_SUCCESS 0
- // Request failed, more information elsewhere in the message
- #define CMC_STATUS_FAILED 2
- // The request body part has not yet been processed. Requester is responsible
- // to poll back. May only be returned for certificate request operations.
- #define CMC_STATUS_PENDING 3
- // The requested operation is not supported
- #define CMC_STATUS_NO_SUPPORT 4
- // Confirmation using the idConfirmCertAcceptance control is required
- // before use of certificate
- #define CMC_STATUS_CONFIRM_REQUIRED 5
- //
- // dwFailInfo values
- //
- // Unrecognized or unsupported algorithm
- #define CMC_FAIL_BAD_ALG 0
- // Integrity check failed
- #define CMC_FAIL_BAD_MESSAGE_CHECK 1
- // Transaction not permitted or supported
- #define CMC_FAIL_BAD_REQUEST 2
- // Message time field was not sufficiently close to the system time
- #define CMC_FAIL_BAD_TIME 3
- // No certificate could be identified matching the provided criteria
- #define CMC_FAIL_BAD_CERT_ID 4
- // A requested X.509 extension is not supported by the recipient CA.
- #define CMC_FAIL_UNSUPORTED_EXT 5
- // Private key material must be supplied
- #define CMC_FAIL_MUST_ARCHIVE_KEYS 6
- // Identification Attribute failed to verify
- #define CMC_FAIL_BAD_IDENTITY 7
- // Server requires a POP proof before issuing certificate
- #define CMC_FAIL_POP_REQUIRED 8
- // POP processing failed
- #define CMC_FAIL_POP_FAILED 9
- // Server policy does not allow key re-use
- #define CMC_FAIL_NO_KEY_REUSE 10
- #define CMC_FAIL_INTERNAL_CA_ERROR 11
- #define CMC_FAIL_TRY_LATER 12
- //+-------------------------------------------------------------------------
- // CMC_ADD_EXTENSIONS
- //
- // Certificate Management Messages over CMS (CMC) Add Extensions control
- // attribute.
- //
- // pvStructInfo points to a CMC_ADD_EXTENSIONS_INFO.
- //--------------------------------------------------------------------------
- typedef struct _CMC_ADD_EXTENSIONS_INFO {
- DWORD dwCmcDataReference;
- DWORD cCertReference;
- DWORD *rgdwCertReference;
- DWORD cExtension;
- PCERT_EXTENSION rgExtension;
- } CMC_ADD_EXTENSIONS_INFO, *PCMC_ADD_EXTENSIONS_INFO;
- //+-------------------------------------------------------------------------
- // CMC_ADD_ATTRIBUTES
- //
- // Certificate Management Messages over CMS (CMC) Add Attributes control
- // attribute.
- //
- // pvStructInfo points to a CMC_ADD_ATTRIBUTES_INFO.
- //--------------------------------------------------------------------------
- typedef struct _CMC_ADD_ATTRIBUTES_INFO {
- DWORD dwCmcDataReference;
- DWORD cCertReference;
- DWORD *rgdwCertReference;
- DWORD cAttribute;
- PCRYPT_ATTRIBUTE rgAttribute;
- } CMC_ADD_ATTRIBUTES_INFO, *PCMC_ADD_ATTRIBUTES_INFO;
- //+-------------------------------------------------------------------------
- // X509_CERTIFICATE_TEMPLATE
- // szOID_CERTIFICATE_TEMPLATE
- //
- // pvStructInfo points to following CERT_TEMPLATE_EXT data structure.
- //
- //--------------------------------------------------------------------------
- typedef struct _CERT_TEMPLATE_EXT {
- LPSTR pszObjId;
- DWORD dwMajorVersion;
- BOOL fMinorVersion; // TRUE for a minor version
- DWORD dwMinorVersion;
- } CERT_TEMPLATE_EXT, *PCERT_TEMPLATE_EXT;
- //+=========================================================================
- // Object IDentifier (OID) Installable Functions: Data Structures and APIs
- //==========================================================================
- typedef void *HCRYPTOIDFUNCSET;
- typedef void *HCRYPTOIDFUNCADDR;
- // Predefined OID Function Names
- #define CRYPT_OID_ENCODE_OBJECT_FUNC "CryptDllEncodeObject"
- #define CRYPT_OID_DECODE_OBJECT_FUNC "CryptDllDecodeObject"
- #define CRYPT_OID_ENCODE_OBJECT_EX_FUNC "CryptDllEncodeObjectEx"
- #define CRYPT_OID_DECODE_OBJECT_EX_FUNC "CryptDllDecodeObjectEx"
- #define CRYPT_OID_CREATE_COM_OBJECT_FUNC "CryptDllCreateCOMObject"
- #define CRYPT_OID_VERIFY_REVOCATION_FUNC "CertDllVerifyRevocation"
- #define CRYPT_OID_VERIFY_CTL_USAGE_FUNC "CertDllVerifyCTLUsage"
- #define CRYPT_OID_FORMAT_OBJECT_FUNC "CryptDllFormatObject"
- #define CRYPT_OID_FIND_OID_INFO_FUNC "CryptDllFindOIDInfo"
- #define CRYPT_OID_FIND_LOCALIZED_NAME_FUNC "CryptDllFindLocalizedName"
- // CryptDllEncodeObject has same function signature as CryptEncodeObject.
- // CryptDllDecodeObject has same function signature as CryptDecodeObject.
- // CryptDllEncodeObjectEx has same function signature as CryptEncodeObjectEx.
- // The Ex version MUST support the CRYPT_ENCODE_ALLOC_FLAG option.
- //
- // If an Ex function isn't installed or registered, then, attempts to find
- // a non-EX version. If the ALLOC flag is set, then, CryptEncodeObjectEx,
- // does the allocation and calls the non-EX version twice.
- // CryptDllDecodeObjectEx has same function signature as CryptDecodeObjectEx.
- // The Ex version MUST support the CRYPT_DECODE_ALLOC_FLAG option.
- //
- // If an Ex function isn't installed or registered, then, attempts to find
- // a non-EX version. If the ALLOC flag is set, then, CryptDecodeObjectEx,
- // does the allocation and calls the non-EX version twice.
- // CryptDllCreateCOMObject has the following signature:
- // BOOL WINAPI CryptDllCreateCOMObject(
- // IN DWORD dwEncodingType,
- // IN LPCSTR pszOID,
- // IN PCRYPT_DATA_BLOB pEncodedContent,
- // IN DWORD dwFlags,
- // IN REFIID riid,
- // OUT void **ppvObj);
- // CertDllVerifyRevocation has the same signature as CertVerifyRevocation
- // (See CertVerifyRevocation for details on when called)
- // CertDllVerifyCTLUsage has the same signature as CertVerifyCTLUsage
- // CryptDllFindOIDInfo currently is only used to store values used by
- // CryptFindOIDInfo. See CryptFindOIDInfo() for more details.
- // CryptDllFindLocalizedName is only used to store localized string
- // values used by CryptFindLocalizedName. See CryptFindLocalizedName() for
- // more details.
- // Example of a complete OID Function Registry Name:
- // HKEY_LOCAL_MACHINESoftwareMicrosoftCryptographyOID
- // Encoding Type 1CryptDllEncodeObject1.2.3
- //
- // The key's L"Dll" value contains the name of the Dll.
- // The key's L"FuncName" value overrides the default function name
- #define CRYPT_OID_REGPATH "Software\Microsoft\Cryptography\OID"
- #define CRYPT_OID_REG_ENCODING_TYPE_PREFIX "EncodingType "
- #define CRYPT_OID_REG_DLL_VALUE_NAME L"Dll"
- #define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME L"FuncName"
- #define CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A "FuncName"
- // CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG can be set in the key's L"CryptFlags"
- // value to register the functions before the installed functions.
- //
- // CryptSetOIDFunctionValue must be called to set this value. L"CryptFlags"
- // must be set using a dwValueType of REG_DWORD.
- #define CRYPT_OID_REG_FLAGS_VALUE_NAME L"CryptFlags"
- // OID used for Default OID functions
- #define CRYPT_DEFAULT_OID "DEFAULT"
- typedef struct _CRYPT_OID_FUNC_ENTRY {
- LPCSTR pszOID;
- void *pvFuncAddr;
- } CRYPT_OID_FUNC_ENTRY, *PCRYPT_OID_FUNC_ENTRY;
- #define CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG 1
- //+-------------------------------------------------------------------------
- // Install a set of callable OID function addresses.
- //
- // By default the functions are installed at end of the list.
- // Set CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG to install at beginning of list.
- //
- // hModule should be updated with the hModule passed to DllMain to prevent
- // the Dll containing the function addresses from being unloaded by
- // CryptGetOIDFuncAddress/CryptFreeOIDFunctionAddress. This would be the
- // case when the Dll has also regsvr32'ed OID functions via
- // CryptRegisterOIDFunction.
- //
- // DEFAULT functions are installed by setting rgFuncEntry[].pszOID =
- // CRYPT_DEFAULT_OID.
- //--------------------------------------------------------------------------
- WINCRYPT32API
- BOOL
- WINAPI
- CryptInstallOIDFunctionAddress(
- IN HMODULE hModule, // hModule passed to DllMain
- IN DWORD dwEncodingType,
- IN LPCSTR pszFuncName,
- IN DWORD cFuncEntry,
- IN const CRYPT_OID_FUNC_ENTRY rgFuncEntry[],
- IN DWORD dwFlags
- );
- //+-------------------------------------------------------------------------
- // Initialize and return handle to the OID function set identified by its
- // function name.
- //
- // If the set already exists, a handle to the existing set is returned.
- //--------------------------------------------------------------------------
- WINCRYPT32API
- HCRYPTOIDFUNCSET
- WINAPI
- CryptInitOIDFunctionSet(
- IN LPCSTR pszFuncName,
- IN DWORD dwFlags
- );
- //+-------------------------------------------------------------------------
- // Search the list of installed functions for an encoding type and OID match.
- // If not found, search the registry.
- //
- // For success, returns TRUE with *ppvFuncAddr updated with the function's
- // address and *phFuncAddr updated with the function address's handle.
- // The function's handle is AddRef'ed. CryptFreeOIDFunctionAddress needs to
- // be called to release it.
- //
- // For a registry match, the Dll containing the function is loaded.
- //
- // By default, both the registered and installed function lists are searched.
- // Set CRYPT_GET_INSTALLED_OID_FUNC_FLAG to only search the installed list
- // of functions. This flag would be set by a registered function to get
- // the address of a pre-installed function it was replacing. For example,
- // the registered function might handle a new special case and call the
- // pre-installed function to handle the remaining cases.
- //--------------------------------------------------------------------------
- WINCRYPT32API
- BOOL
- WINAPI
- CryptGetOIDFunctionAddress(
- IN HCRYPTOIDFUNCSET hFuncSet,
- IN DWORD dwEncodingType,
- IN LPCSTR pszOID,
- IN DWORD dwFlags,
- OUT void **ppvFuncAddr,
- OUT HCRYPTOIDFUNCADDR *phFuncAddr
- );
- #define CRYPT_GET_INSTALLED_OID_FUNC_FLAG 0x1
- //+-------------------------------------------------------------------------
- // Get the list of registered default Dll entries for the specified
- // function set and encoding type.
- //
- // The returned list consists of none, one or more null terminated Dll file
- // names. The list is terminated with an empty (L"