![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Union that identifies a recipient for whom a transient key is wanted. More...
Data Fields | |
| ubyte4 | type |
| union { | |
| CMSIssuerSerialNumber issuerAndSerialNumber | |
| ASN1_ITEMPTR subjectKeyIdentifier | |
| } | u |
This structure serves as a member in a union in the CMSRecipientId structure. The CMS_GetPrivateKey() callback function passes in a pointer to a CMSRecipientId() structure to identify the recipient for which the key is wanted.
The CMSKeyTransRecipientId structure is defined as:
typedef struct CMSKeyTransRecipientId
{
ubyte4 type;
union
{
CMSIssuerSerialNumber issuerAndSerialNumber; // type = NO_TAG
ASN1_ITEMPTR subjectKeyIdentifier; // type = 0 OCTETSTRING
} u;
} CMSKeyTransRecipientId;
If the type is NO_TAG, the issuerAndSerialNumber member applies. This member supplies a pointer to a CMSIssuerSerialNumber structure.
If the type is 0, the subjectKeyIdentifier member applies. This member supplies an ASN1_ITEMPTR that provides offset and buffer length information that you can use to find subject key identifier information in the CStream that was passed to the CMS_GetPrivateKey() callback function.
This structure reflects the layout of the RecipientIdentifier object of the KeyTransRecipientInfo object. The RecipientIdentifier is a choice.
KeyTransRecipientInfo ::= SEQUENCE {
version CMSVersion, -- always set to 0 or 2
rid RecipientIdentifier,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
encryptedKey EncryptedKey } RecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier }
CMSKeyTransRecipientId.issuerAndSerialNumber corresponds to the issuerAndSerialNumber object. CMSKeyTransRecipientId.subjectKeyIdentifier corresponds to the subjectKeyIdentifier object.