CMS_ADD1_RECIPIENT_CERT(3ossl)
π NAME π
okay bestie, welcome to the CMS_ADD1_RECIPIENT_CERT(3ossl) page β this is the manual for adding recipients to a CMS enveloped data structure. the main-character functions are CMS_add1_recipient, CMS_add1_recipient_cert, and CMS_add0_recipient_key, and they are literally here to help you add recipients. π
β¨
π οΈ SYNOPSIS π οΈ
#include <openssl/cms.h>
CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
EVP_PKEY *originatorPrivKey,
X509 *originator, unsigned int flags);
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
X509 *recip, 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 πΈ
CMS_add1_recipient()β adds recipientrecipand provides the originator pkeyoriginatorPrivKeyand originator certificateoriginatortoCMS_ContentInfo. the originator-related fields are relevant only in the case when thekeyAgreementmethod of providing of the shared key is in use. πCMS_add1_recipient_cert()β adds recipientreciptoCMS_ContentInfoenveloped data structurecmsas aKeyTransRecipientInfostructure. it's giving cert-recipient realness.CMS_add0_recipient_key()β adds symmetric keykeyof lengthkeylenusing wrapping algorithmnid, identifieridof lengthidlen, and optional valuesdate,otherTypeIdandotherTypetoCMS_ContentInfoenveloped data structurecmsas aKEKRecipientInfostructure. π
the CMS_ContentInfo structure should be obtained from an initial call to CMS_encrypt() with the flag CMS_PARTIAL set. no cap, that's the setup vibe. β¨
β¨ NOTES β¨
the main purpose of this function is to provide finer control over a CMS enveloped data structure where the simpler CMS_encrypt() 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. π«Ά
OpenSSL will by default identify recipient certificates using issuer name and serial number. if CMS_USE_KEYID is set, it will use the subject key identifier value instead. heads up: 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. π₯
π 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. that's it β no extra drama, just the pointer or NULL. π
π¦ SEE ALSO π¦
ERR_get_error(3), CMS_decrypt(3), CMS_final(3), β go check these out too, bestie. iykyk β¨
β HISTORY β
CMS_add1_recipient_cert and CMS_add0_recipient_key were added in OpenSSL 3.0. periodt. π
π COPYRIGHT π
Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
mwah π that's the whole page, bestie β this one is from OpenSSL 3.5.0, dated 2026-09-25. now go add those recipients and slay fr fr πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms