diff --git a/mozilla/security/nss/lib/smime/cms.h b/mozilla/security/nss/lib/smime/cms.h index b2ec97126e6..c3f6d842310 100644 --- a/mozilla/security/nss/lib/smime/cms.h +++ b/mozilla/security/nss/lib/smime/cms.h @@ -34,7 +34,7 @@ /* * Interfaces of the CMS implementation. * - * $Id: cms.h,v 1.16 2003-02-28 23:32:29 relyea%netscape.com Exp $ + * $Id: cms.h,v 1.17 2003-03-11 03:38:53 jpierre%netscape.com Exp $ */ #ifndef _CMS_H_ @@ -903,6 +903,12 @@ NSS_CMSRecipientInfo_GetVersion(NSSCMSRecipientInfo *ri); extern SECItem * NSS_CMSRecipientInfo_GetEncryptedKey(NSSCMSRecipientInfo *ri, int subIndex); +/* + * NSS_CMSRecipientInfo_Encode - encode an NSS_CMSRecipientInfo as ASN.1 + */ +SECStatus NSS_CMSRecipientInfo_Encode(PRArenaPool* poolp, + const NSSCMSRecipientInfo *src, + SECItem* returned); extern SECOidTag NSS_CMSRecipientInfo_GetKeyEncryptionAlgorithmTag(NSSCMSRecipientInfo *ri); diff --git a/mozilla/security/nss/lib/smime/cmsrecinfo.c b/mozilla/security/nss/lib/smime/cmsrecinfo.c index 33239e03263..ad30b2d69e7 100644 --- a/mozilla/security/nss/lib/smime/cmsrecinfo.c +++ b/mozilla/security/nss/lib/smime/cmsrecinfo.c @@ -34,7 +34,7 @@ /* * CMS recipientInfo methods. * - * $Id: cmsrecinfo.c,v 1.12 2003-03-03 19:46:22 relyea%netscape.com Exp $ + * $Id: cmsrecinfo.c,v 1.13 2003-03-11 03:38:54 jpierre%netscape.com Exp $ */ #include "cmslocal.h" @@ -716,3 +716,18 @@ SECStatus NSS_CMSRecipientInfo_GetCertAndKey(NSSCMSRecipientInfo *ri, return rv; } + +SECStatus NSS_CMSRecipientInfo_Encode(PRArenaPool* poolp, + const NSSCMSRecipientInfo *src, + SECItem* returned) +{ + extern const SEC_ASN1Template NSSCMSRecipientInfoTemplate[]; + SECStatus rv = SECFailure; + if (!src || !returned) { + PORT_SetError(SEC_ERROR_INVALID_ARGS); + } else if (SEC_ASN1EncodeItem(poolp, returned, src, + NSSCMSRecipientInfoTemplate)) { + rv = SECSuccess; + } + return rv; +} diff --git a/mozilla/security/nss/lib/smime/smime.def b/mozilla/security/nss/lib/smime/smime.def index 9cdeb658f19..ac0bbd40868 100644 --- a/mozilla/security/nss/lib/smime/smime.def +++ b/mozilla/security/nss/lib/smime/smime.def @@ -234,6 +234,7 @@ NSS_CMSRecipientInfo_UnwrapBulkKey; ;+ global: NSS_CMSRecipientInfo_CreateNew; NSS_CMSRecipientInfo_CreateFromDER; +NSS_CMSRecipientInfo_Encode; NSS_CMSRecipientInfo_GetCertAndKey; ;+ local: ;+ *;