CMS_ADD1_RECIPIENT_CERT(3)
πΈ NAME πΈ
okay bestie, this is CMS_ADD1_RECIPIENT_CERT(3), and it's all about CMS_add1_recipient_cert and CMS_add0_recipient_key β literally the functions that add recipients to a CMS EnvelopedData structure. π
β¨ SYNOPSIS β¨
You're linking the library βlibcryptoβ, and the include is exactly:
#include <openssl/cms.h>
CMS_RecipientInfo *
CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *certificate,
unsigned int flags);
CMS_RecipientInfo *
CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
unsigned char *key, size_t keylen, unsigned char *id, size_t idlen,
ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId,
ASN1_TYPE *otherType);
π¦ DESCRIPTION π¦
These functions add a new RecipientInfo structure to the recipientInfos field of the EnvelopedData structure cms, and that cms should have come from an initial call to CMS_encrypt(3) with the flag CMS_PARTIAL set. no cap. β¨
CMS_add1_recipient_cert()β adds the recipient certificate as aKeyTransRecipientInfostructure. πCMS_add0_recipient_key()β adds the symmetric key of lengthkeylenusing the wrapping algorithmnid, the identifieridof lengthidlen, and the optional valuesdate,otherTypeId, andotherTypeas aKEKRecipientInfostructure. π«Ά
The main purpose of these functions is to provide finer control over a CMS EnvelopedData structure where the simpler CMS_encrypt(3) function defaults are not appropriate, for example if one or more KEKRecipientInfo structures need to be added. New attributes can also be added using the returned CMS_RecipientInfo structure and the CMS attribute utility functions. π
By default, recipient certificates are identified using issuer name and serial number. If the flag CMS_USE_KEYID is set, the subject key identifier value is used instead. An error occurs if all recipient certificates do not have a subject key identifier extension. β οΈ
Currently only AES based key wrapping algorithms are supported for nid, specifically NID_id_aes128_wrap, NID_id_aes192_wrap, and NID_id_aes256_wrap. If nid is set to NID_undef, then an AES wrap algorithm will be used consistent with keylen. slay. π₯
π₯Ί RETURN VALUES π₯Ί
CMS_add1_recipient_cert() and CMS_add0_recipient_key() return an internal pointer to the CMS_RecipientInfo structure just added or NULL if an error occurs. π
π SEE ALSO π
π STANDARDS π
RFC 5652: Cryptographic Message Syntax
- section 6.1: EnvelopedData Type
- section 6.2.1: KeyTransRecipientInfo Type
- section 6.2.3: KEKRecipientInfo Type
π HISTORY π
CMS_add1_recipient_cert() and CMS_add0_recipient_key() first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 6.7. iconic. π
okay that's the whole page, bestie. this one is from Debian, dated June 8, 2025 β CMS_ADD1_RECIPIENT_CERT(3), periodt. πβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2008 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms