michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef PKIT_H michael@0: #include "pkit.h" michael@0: #endif /* PKIT_H */ michael@0: michael@0: #ifndef PKIM_H michael@0: #include "pkim.h" michael@0: #endif /* PKIM_H */ michael@0: michael@0: /* This is defined in pki3hack.c */ michael@0: NSS_EXTERN nssDecodedCert * michael@0: nssDecodedPKIXCertificate_Create ( michael@0: NSSArena *arenaOpt, michael@0: NSSDER *encoding michael@0: ); michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: nssDecodedPKIXCertificate_Destroy ( michael@0: nssDecodedCert *dc michael@0: ); michael@0: michael@0: NSS_IMPLEMENT nssDecodedCert * michael@0: nssDecodedCert_Create ( michael@0: NSSArena *arenaOpt, michael@0: NSSDER *encoding, michael@0: NSSCertificateType type michael@0: ) michael@0: { michael@0: nssDecodedCert *rvDC = NULL; michael@0: switch(type) { michael@0: case NSSCertificateType_PKIX: michael@0: rvDC = nssDecodedPKIXCertificate_Create(arenaOpt, encoding); michael@0: break; michael@0: default: michael@0: #if 0 michael@0: nss_SetError(NSS_ERROR_INVALID_ARGUMENT); michael@0: #endif michael@0: return (nssDecodedCert *)NULL; michael@0: } michael@0: return rvDC; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: nssDecodedCert_Destroy ( michael@0: nssDecodedCert *dc michael@0: ) michael@0: { michael@0: if (!dc) { michael@0: return PR_FAILURE; michael@0: } michael@0: switch(dc->type) { michael@0: case NSSCertificateType_PKIX: michael@0: return nssDecodedPKIXCertificate_Destroy(dc); michael@0: default: michael@0: #if 0 michael@0: nss_SetError(NSS_ERROR_INVALID_ARGUMENT); michael@0: #endif michael@0: break; michael@0: } michael@0: return PR_FAILURE; michael@0: } michael@0: