rvDC->data = (void *)CERT_DecodeDERCertificate(&secDER, PR_TRUE, NULL); rvDC->getIdentifier = nss3certificate_getIdentifier; rvDC->getIssuerIdentifier = nss3certificate_getIssuerIdentifier; rvDC->matchIdentifier = nss3certificate_matchIdentifier; rvDC->isValidIssuer = nss3certificate_isValidIssuer; rvDC->getUsage = nss3certificate_getUsage; rvDC->isValidAtTime = nss3certificate_isValidAtTime; rvDC->isNewerThan = nss3certificate_isNewerThan; rvDC->matchUsage = nss3certificate_matchUsage; rvDC->getEmailAddress = nss3certificate_getEmailAddress; rvDC->getDERSerialNumber = nss3certificate_getDERSerialNumber;
cert = CERT_DecodeDERCertificate(&secDER, PR_TRUE, NULL); if (cert) { rvDC = nss_ZNEW(arenaOpt, nssDecodedCert); if (rvDC) { rvDC->type                = NSSCertificateType_PKIX; rvDC->data                = (void *)cert; rvDC->getIdentifier       = nss3certificate_getIdentifier; rvDC->getIssuerIdentifier = nss3certificate_getIssuerIdentifier; rvDC->matchIdentifier     = nss3certificate_matchIdentifier; rvDC->isValidIssuer       = nss3certificate_isValidIssuer; rvDC->getUsage            = nss3certificate_getUsage; rvDC->isValidAtTime       = nss3certificate_isValidAtTime; rvDC->isNewerThan         = nss3certificate_isNewerThan; rvDC->matchUsage          = nss3certificate_matchUsage; rvDC->getEmailAddress     = nss3certificate_getEmailAddress; rvDC->getDERSerialNumber  = nss3certificate_getDERSerialNumber; } else { CERT_DestroyCertificate(cert); } }
nssDecodedPKIXCertificate_Create (  NSSArena *arenaOpt,  NSSDER *encoding){    nssDecodedCert *rvDC;    SECItem secDER;    rvDC = nss_ZNEW(arenaOpt, nssDecodedCert);    rvDC->type = NSSCertificateType_PKIX;    SECITEM_FROM_NSSITEM(&secDER, encoding);    rvDC->data = (void *)CERT_DecodeDERCertificate(&secDER, PR_TRUE, NULL);    rvDC->getIdentifier = nss3certificate_getIdentifier;    rvDC->getIssuerIdentifier = nss3certificate_getIssuerIdentifier;    rvDC->matchIdentifier = nss3certificate_matchIdentifier;    rvDC->isValidIssuer = nss3certificate_isValidIssuer;    rvDC->getUsage = nss3certificate_getUsage;    rvDC->isValidAtTime = nss3certificate_isValidAtTime;    rvDC->isNewerThan = nss3certificate_isNewerThan;    rvDC->matchUsage = nss3certificate_matchUsage;    rvDC->getEmailAddress = nss3certificate_getEmailAddress;    rvDC->getDERSerialNumber = nss3certificate_getDERSerialNumber;    return rvDC;}