Esempio n. 1
0
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;
}
Esempio n. 2
0
NSSCMSRecipientInfo *
NSS_CMSRecipientInfo_CreateWithSubjKeyID(NSSCMSMessage   *cmsg, 
                                     SECItem         *subjKeyID,
                                     SECKEYPublicKey *pubKey)
{
    return nss_cmsrecipientinfo_create(cmsg, NSSCMSRecipientID_SubjectKeyID, 
                                       NULL, pubKey, subjKeyID, NULL, NULL);
}
Esempio n. 3
0
SecCmsRecipientInfoRef
SecCmsRecipientInfoCreateWithSubjKeyID(SecCmsEnvelopedDataRef envd, 
                                     const SecAsn1Item * subjKeyID,
                                     SecPublicKeyRef pubKey)
{
    return nss_cmsrecipientinfo_create(envd, SecCmsRecipientIDSubjectKeyID, 
                                       NULL, pubKey, subjKeyID);
}
Esempio n. 4
0
SecCmsRecipientInfoRef
SecCmsRecipientInfoCreateWithSubjKeyID(SecCmsMessageRef cmsg, 
                                     CSSM_DATA_PTR subjKeyID,
                                     SecPublicKeyRef pubKey)
{
    return nss_cmsrecipientinfo_create(cmsg, SecCmsRecipientIDSubjectKeyID, 
                                       NULL, pubKey, subjKeyID);
}
Esempio n. 5
0
/*
 * 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);
}
Esempio n. 6
0
NSSCMSRecipientInfo *
NSS_CMSRecipientInfo_CreateFromDER(SECItem* input, void* pwfn_arg)
{
    return nss_cmsrecipientinfo_create(NULL, NSSCMSRecipientID_BrandNew, NULL, 
                                       NULL, NULL, pwfn_arg, input);
}
Esempio n. 7
0
NSSCMSRecipientInfo *
NSS_CMSRecipientInfo_CreateNew(void* pwfn_arg)
{
    return nss_cmsrecipientinfo_create(NULL, NSSCMSRecipientID_BrandNew, NULL, 
                                       NULL, NULL, pwfn_arg, NULL);
}
Esempio n. 8
0
/*
 * 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);
}
Esempio n. 9
0
/*
 * 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);
}