![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Union that identifies a CMS recipient. More...
Data Fields | |
| ubyte4 | type |
| Tells you how to interpret the u member of a CMSKeyAgreeRecipientId structure. More... | |
| union { | |
| CMSIssuerSerialNumber issuerAndSerialNumber | |
| CMSOriginatorPublicKey originatorKey | |
| ASN1_ITEMPTR subjectKeyIdentifier | |
| } | u |
| Recipient for which the callback wants a key. More... | |
This structure is a member in a union in the CMSRecipientId structure.
The CMS_GetPrivateKey() callback function passes pointer to a CMSRecipientId() structure to identify the recipient from which the key is wanted.
The CMSKeyAgreeRecipientId structure is defined as:
typedef struct CMSKeyAgreeRecipientId
{
ubyte4 type;
union
{
CMSIssuerSerialNumber issuerAndSerialNumber; // type = NO_TAG
ASN1_ITEMPTR subjectKeyIdentifier; // type = 0 OCTETSTRING
CMSOriginatorPublicKey originatorKey; // type = 1 /
} u;
} CMSKeyAgreeRecipientId;
To interpret this structure, read the type value.
The CMSKeyAgreeRecipientId structure reflects the layout of the originator component of the KeyAgreeRecipientInfo ASN.1 object:
KeyAgreeRecipientInfo ::= SEQUENCE {
version CMSVersion, -- always set to 3
originator [0] EXPLICIT OriginatorIdentifierOrKey,
ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
recipientEncryptedKeys RecipientEncryptedKeys } OriginatorIdentifierOrKey ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier,
originatorKey [1] OriginatorPublicKey } OriginatorPublicKey ::= SEQUENCE {
algorithm AlgorithmIdentifier,
publicKey BIT STRING }
The OriginatorIdentifierOrKey object is a choice of an issuerAndSerialNumber object, a subjectKeyIdentifier object, and an originatorKey object.
| ubyte4 CMSKeyAgreeRecipientId::type |
Tells you how to interpret the u member of a CMSKeyAgreeRecipientId structure.
| union { ... } CMSKeyAgreeRecipientId::u |
Recipient for which the callback wants a key.