Go to the documentation of this file.
31 #ifndef _PKCS7_COMMON_H
32 #define _PKCS7_COMMON_H
39 #ifndef PKCS7_DES_SUPPORT
40 #define PKCS7_DES_SUPPORT DISABLED
41 #elif (PKCS7_DES_SUPPORT != ENABLED && PKCS7_DES_SUPPORT != DISABLED)
42 #error PKCS7_DES_SUPPORT parameter is not valid
46 #ifndef PKCS7_3DES_SUPPORT
47 #define PKCS7_3DES_SUPPORT DISABLED
48 #elif (PKCS7_3DES_SUPPORT != ENABLED && PKCS7_3DES_SUPPORT != DISABLED)
49 #error PKCS7_3DES_SUPPORT parameter is not valid
53 #ifndef PKCS7_AES_SUPPORT
54 #define PKCS7_AES_SUPPORT ENABLED
55 #elif (PKCS7_AES_SUPPORT != ENABLED && PKCS7_AES_SUPPORT != DISABLED)
56 #error PKCS7_AES_SUPPORT parameter is not valid
60 #ifndef PKCS7_MD5_SUPPORT
61 #define PKCS7_MD5_SUPPORT DISABLED
62 #elif (PKCS7_MD5_SUPPORT != ENABLED && PKCS7_MD5_SUPPORT != DISABLED)
63 #error PKCS7_MD5_SUPPORT parameter is not valid
67 #ifndef PKCS7_SHA1_SUPPORT
68 #define PKCS7_SHA1_SUPPORT DISABLED
69 #elif (PKCS7_SHA1_SUPPORT != ENABLED && PKCS7_SHA1_SUPPORT != DISABLED)
70 #error PKCS7_SHA1_SUPPORT parameter is not valid
74 #ifndef PKCS7_SHA224_SUPPORT
75 #define PKCS7_SHA224_SUPPORT DISABLED
76 #elif (PKCS7_SHA224_SUPPORT != ENABLED && PKCS7_SHA224_SUPPORT != DISABLED)
77 #error PKCS7_SHA224_SUPPORT parameter is not valid
81 #ifndef PKCS7_SHA256_SUPPORT
82 #define PKCS7_SHA256_SUPPORT ENABLED
83 #elif (PKCS7_SHA256_SUPPORT != ENABLED && PKCS7_SHA256_SUPPORT != DISABLED)
84 #error PKCS7_SHA256_SUPPORT parameter is not valid
88 #ifndef PKCS7_SHA384_SUPPORT
89 #define PKCS7_SHA384_SUPPORT ENABLED
90 #elif (PKCS7_SHA384_SUPPORT != ENABLED && PKCS7_SHA384_SUPPORT != DISABLED)
91 #error PKCS7_SHA384_SUPPORT parameter is not valid
95 #ifndef PKCS7_SHA512_SUPPORT
96 #define PKCS7_SHA512_SUPPORT ENABLED
97 #elif (PKCS7_SHA512_SUPPORT != ENABLED && PKCS7_SHA512_SUPPORT != DISABLED)
98 #error PKCS7_SHA512_SUPPORT parameter is not valid
102 #ifndef PKCS7_RSA_SUPPORT
103 #define PKCS7_RSA_SUPPORT ENABLED
104 #elif (PKCS7_RSA_SUPPORT != ENABLED && PKCS7_RSA_SUPPORT != DISABLED)
105 #error PKCS7_RSA_SUPPORT parameter is not valid
109 #ifndef PKCS7_MAX_DIGEST_ALGO_IDENTIFIERS
110 #define PKCS7_MAX_DIGEST_ALGO_IDENTIFIERS 2
111 #elif (PKCS7_MAX_DIGEST_ALGO_IDENTIFIERS < 1)
112 #error PKCS7_MAX_DIGEST_ALGO_IDENTIFIERS parameter is not valid
116 #ifndef PKCS7_MAX_CERTIFICATES
117 #define PKCS7_MAX_CERTIFICATES 4
118 #elif (PKCS7_MAX_CERTIFICATES < 1)
119 #error PKCS7_MAX_CERTIFICATES parameter is not valid
123 #ifndef PKCS7_MAX_CRLS
124 #define PKCS7_MAX_CRLS 4
125 #elif (PKCS7_MAX_CRLS < 1)
126 #error PKCS7_MAX_CRLS parameter is not valid
130 #ifndef PKCS7_MAX_SIGNER_INFOS
131 #define PKCS7_MAX_SIGNER_INFOS 2
132 #elif (PKCS7_MAX_SIGNER_INFOS < 1)
133 #error PKCS7_MAX_SIGNER_INFOS parameter is not valid
137 #ifndef PKCS7_MAX_RECIPIENT_INFOS
138 #define PKCS7_MAX_RECIPIENT_INFOS 2
139 #elif (PKCS7_MAX_RECIPIENT_INFOS < 1)
140 #error PKCS7_MAX_RECIPIENT_INFOS parameter is not valid
144 #ifndef PKCS7_MAX_CUSTOM_ATTRIBUTES
145 #define PKCS7_MAX_CUSTOM_ATTRIBUTES 4
146 #elif (PKCS7_MAX_CUSTOM_ATTRIBUTES < 1)
147 #error PKCS7_MAX_CUSTOM_ATTRIBUTES parameter is not valid
151 #define PKCS7_MAX_ENCR_KEY_SIZE 32
394 const uint8_t *attribute2,
size_t attributeLen2);
397 const uint8_t *
data,
size_t length, uint8_t *digest);
int_t pkcs7CompAttributes(const uint8_t *attribute1, size_t attributeLen1, const uint8_t *attribute2, size_t attributeLen2)
Compare attributes.
X.509 common definitions.
const CipherAlgo * pkcs7GetCipherAlgo(const uint8_t *oid, size_t length)
Get the cipher algorithm that matches the specified OID.
const uint8_t PKCS7_OID[8]
X509SerialNumber serialNumber
Pkcs7Certificates certificates
X509OctetString encryptedContent
uint_t numCustomAttributes
Pkcs7AuthenticatedAttributes authenticatedAttributes
X509OctetString messageDigest
X509OctetString contentType
uint_t numCustomAttributes
const uint8_t PKCS7_SIGNED_DATA_OID[9]
Pkcs7ContentInfo contentInfo
const uint8_t PKCS7_SIGNED_AND_ENVELOPED_DATA_OID[9]
X509OctetString contentType
const uint8_t PKCS7_DATA_OID[9]
Pkcs7UnauthenticatedAttributes unauthenticatedAttributes
uint_t pkcs7GetKeyLength(const uint8_t *oid, size_t length)
Get the encryption key length to be used for PBES2 operation.
Content encryption algorithm.
const uint8_t PKCS7_ENVELOPED_DATA_OID[9]
const HashAlgo * pkcs7GetHashAlgo(const uint8_t *oid, size_t length)
Get the hash algorithm that matches the specified OID.
const uint8_t PKCS9_SIGNING_TIME_OID[9]
Pkcs7RecipientInfos recipientInfos
#define PKCS7_MAX_CERTIFICATES
#define PKCS7_MAX_RECIPIENT_INFOS
Encrypted content information.
const HashAlgo * pkcs7GetSignHashAlgo(const uint8_t *oid, size_t length)
Get the signature hash algorithm that matches the specified OID.
X509OctetString contentType
X509AlgoId keyEncryptionAlgo
#define PKCS7_MAX_CUSTOM_ATTRIBUTES
X509OctetString encryptedKey
X509OctetString encryptedDigest
#define PKCS7_MAX_SIGNER_INFOS
General definitions for cryptographic algorithms.
#define PKCS7_MAX_DIGEST_ALGO_IDENTIFIERS
Date and time representation.
Pkcs7DigestAlgos digestAlgos
Collection of digest algorithm identifiers.
Pkcs7EncryptedContentInfo encryptedContentInfo
Pkcs7IssuerAndSerialNumber issuerAndSerialNumber
Pkcs7ContentEncrAlgo contentEncrAlgo
Collection of signer informations.
Issuer and serial number.
const uint8_t PKCS7_DIGESTED_DATA_OID[9]
X509SignAlgoId digestEncryptionAlgo
Unauthenticated attributes.
const uint8_t PKCS7_ENCRYPTED_DATA_OID[9]
Pkcs7Version
Syntax version number.
Common interface for encryption algorithms.
Pkcs7SignerInfos signerInfos
Collection of certificates.
Common interface for hash algorithms.
Authenticated attributes.
const uint8_t PKCS9_CONTENT_TYPE_OID[9]
const uint8_t PKCS9_MESSAGE_DIGEST_OID[9]
Collection of recipient informations.
Pkcs7IssuerAndSerialNumber issuerAndSerialNumber
Signature algorithm identifier.
error_t pkcs7DigestAuthenticatedAttributes(const Pkcs7SignerInfo *signerInfo, const uint8_t *data, size_t length, uint8_t *digest)
Digest the DER encoding of the authenticatedAttributes field.