Fix for 192590 - add ability to encode NSSCMSRecipientInfo . r=javi, wtc

git-svn-id: svn://10.0.0.236/trunk@139251 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jpierre%netscape.com 2003-03-11 03:38:54 +00:00
parent 004488e967
commit d972ffd695
3 changed files with 24 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -234,6 +234,7 @@ NSS_CMSRecipientInfo_UnwrapBulkKey;
;+ global:
NSS_CMSRecipientInfo_CreateNew;
NSS_CMSRecipientInfo_CreateFromDER;
NSS_CMSRecipientInfo_Encode;
NSS_CMSRecipientInfo_GetCertAndKey;
;+ local:
;+ *;