SecCmsRecipientInfoRef SecCmsRecipientInfoCreateWithSubjKeyIDFromCert(SecCmsEnvelopedDataRef envd, SecCertificateRef cert) { SecPublicKeyRef pubKey = NULL; SecAsn1Item subjKeyID = {0, NULL}; SecCmsRecipientInfoRef retVal = NULL; CFDataRef subjectKeyIDData = NULL; if (!envd || !cert) { return NULL; } subjectKeyIDData = SecCertificateGetSubjectKeyID(cert); if (!subjectKeyIDData) goto done; subjKeyID.Length = CFDataGetLength(subjectKeyIDData); subjKeyID.Data = (uint8_t *)CFDataGetBytePtr(subjectKeyIDData); retVal = nss_cmsrecipientinfo_create(envd, SecCmsRecipientIDSubjectKeyID, cert, pubKey, &subjKeyID); done: return retVal; }
NSSCMSRecipientInfo * NSS_CMSRecipientInfo_CreateWithSubjKeyID(NSSCMSMessage *cmsg, SECItem *subjKeyID, SECKEYPublicKey *pubKey) { return nss_cmsrecipientinfo_create(cmsg, NSSCMSRecipientID_SubjectKeyID, NULL, pubKey, subjKeyID, NULL, NULL); }
SecCmsRecipientInfoRef SecCmsRecipientInfoCreateWithSubjKeyID(SecCmsEnvelopedDataRef envd, const SecAsn1Item * subjKeyID, SecPublicKeyRef pubKey) { return nss_cmsrecipientinfo_create(envd, SecCmsRecipientIDSubjectKeyID, NULL, pubKey, subjKeyID); }
SecCmsRecipientInfoRef SecCmsRecipientInfoCreateWithSubjKeyID(SecCmsMessageRef cmsg, CSSM_DATA_PTR subjKeyID, SecPublicKeyRef pubKey) { return nss_cmsrecipientinfo_create(cmsg, SecCmsRecipientIDSubjectKeyID, NULL, pubKey, subjKeyID); }
/* * SecCmsRecipientInfoCreate - create a recipientinfo * * we currently do not create KeyAgreement recipientinfos with multiple * recipientEncryptedKeys the certificate is supposed to have been * verified by the caller */ SecCmsRecipientInfoRef SecCmsRecipientInfoCreate(SecCmsEnvelopedDataRef envd, SecCertificateRef cert) { /* TODO: We might want to prefer subjkeyid */ #if 0 SecCmsRecipientInfoRef info = SecCmsRecipientInfoCreateWithSubjKeyIDFromCert(envd, cert); if (info) return info; else #endif return nss_cmsrecipientinfo_create(envd, SecCmsRecipientIDIssuerSN, cert, NULL, NULL); }
NSSCMSRecipientInfo * NSS_CMSRecipientInfo_CreateFromDER(SECItem* input, void* pwfn_arg) { return nss_cmsrecipientinfo_create(NULL, NSSCMSRecipientID_BrandNew, NULL, NULL, NULL, pwfn_arg, input); }
NSSCMSRecipientInfo * NSS_CMSRecipientInfo_CreateNew(void* pwfn_arg) { return nss_cmsrecipientinfo_create(NULL, NSSCMSRecipientID_BrandNew, NULL, NULL, NULL, pwfn_arg, NULL); }
/* * NSS_CMSRecipientInfo_Create - create a recipientinfo * * we currently do not create KeyAgreement recipientinfos with multiple * recipientEncryptedKeys the certificate is supposed to have been * verified by the caller */ NSSCMSRecipientInfo * NSS_CMSRecipientInfo_Create(NSSCMSMessage *cmsg, CERTCertificate *cert) { return nss_cmsrecipientinfo_create(cmsg, NSSCMSRecipientID_IssuerSN, cert, NULL, NULL, NULL, NULL); }
/* * SecCmsRecipientInfoCreate - create a recipientinfo * * we currently do not create KeyAgreement recipientinfos with multiple * recipientEncryptedKeys the certificate is supposed to have been * verified by the caller */ SecCmsRecipientInfoRef SecCmsRecipientInfoCreate(SecCmsMessageRef cmsg, SecCertificateRef cert) { return nss_cmsrecipientinfo_create(cmsg, SecCmsRecipientIDIssuerSN, cert, NULL, NULL); }