Add DER version of isCA for JSS.

git-svn-id: svn://10.0.0.236/trunk@96571 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
relyea%netscape.com 2001-06-06 23:40:51 +00:00
parent dd4030efa9
commit 3577c25c62
2 changed files with 21 additions and 2 deletions

View File

@ -34,7 +34,7 @@
/*
* cert.h - public data structures and prototypes for the certificate library
*
* $Id: cert.h,v 1.10 2001-05-22 22:01:32 wtc%netscape.com Exp $
* $Id: cert.h,v 1.11 2001-06-06 23:40:50 relyea%netscape.com Exp $
*/
#ifndef _CERT_H_
@ -996,6 +996,9 @@ CERT_MakeCANickname(CERTCertificate *cert);
PRBool
CERT_IsCACert(CERTCertificate *cert, unsigned int *rettype);
PRBool
CERT_IsCADERCert(SECItem *derCert, unsigned int *rettype);
SECStatus
CERT_SaveSMimeProfile(CERTCertificate *cert, SECItem *emailProfile,
SECItem *profileTime);

View File

@ -34,7 +34,7 @@
/*
* Certificate handling code
*
* $Id: certdb.c,v 1.11 2001-04-24 21:27:40 relyea%netscape.com Exp $
* $Id: certdb.c,v 1.12 2001-06-06 23:40:51 relyea%netscape.com Exp $
*/
#include "nssilock.h"
@ -1692,6 +1692,22 @@ CERT_IsCACert(CERTCertificate *cert, unsigned int *rettype)
return(ret);
}
PRBool
CERT_IsCADERCert(SECItem *derCert, unsigned int *type) {
CERTCertificate *cert;
PRBool isCA;
cert = CERT_NewTempCertificate(CERT_GetDefaultCertDB(), derCert, NULL,
PR_FALSE, PR_TRUE);
if (cert == NULL) return NULL;
isCA = CERT_IsCACert(cert,type);
CERT_DestroyCertificate (cert);
return isCA;
}
/*
* is certa newer than certb? If one is expired, pick the other one.
*/