andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #ifndef PKINSS3HACK_H andre@0: #define PKINSS3HACK_H andre@0: andre@0: #ifndef NSSDEVT_H andre@0: #include "nssdevt.h" andre@0: #endif /* NSSDEVT_H */ andre@0: andre@0: #ifndef DEVT_H andre@0: #include "devt.h" andre@0: #endif /* DEVT_H */ andre@0: andre@0: #ifndef NSSPKIT_H andre@0: #include "nsspkit.h" andre@0: #endif /* NSSPKIT_H */ andre@0: andre@0: #include "base.h" andre@0: andre@0: #include "cert.h" andre@0: andre@0: PR_BEGIN_EXTERN_C andre@0: andre@0: #define NSSITEM_FROM_SECITEM(nssit, secit) \ andre@0: (nssit)->data = (void *)(secit)->data; \ andre@0: (nssit)->size = (PRUint32)(secit)->len; andre@0: andre@0: #define SECITEM_FROM_NSSITEM(secit, nssit) \ andre@0: (secit)->data = (unsigned char *)(nssit)->data; \ andre@0: (secit)->len = (unsigned int)(nssit)->size; andre@0: andre@0: NSS_EXTERN NSSTrustDomain * andre@0: STAN_GetDefaultTrustDomain(); andre@0: andre@0: NSS_EXTERN NSSCryptoContext * andre@0: STAN_GetDefaultCryptoContext(); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_InitTokenForSlotInfo(NSSTrustDomain *td, PK11SlotInfo *slot); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_ResetTokenInterator(NSSTrustDomain *td); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_LoadDefaultNSS3TrustDomain(void); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_Shutdown(); andre@0: andre@0: NSS_EXTERN SECStatus andre@0: STAN_AddModuleToDefaultTrustDomain(SECMODModule *module); andre@0: andre@0: NSS_EXTERN SECStatus andre@0: STAN_RemoveModuleFromDefaultTrustDomain(SECMODModule *module); andre@0: andre@0: NSS_EXTERN CERTCertificate * andre@0: STAN_ForceCERTCertificateUpdate(NSSCertificate *c); andre@0: andre@0: NSS_EXTERN CERTCertificate * andre@0: STAN_GetCERTCertificate(NSSCertificate *c); andre@0: andre@0: NSS_EXTERN CERTCertificate * andre@0: STAN_GetCERTCertificateOrRelease(NSSCertificate *c); andre@0: andre@0: NSS_EXTERN NSSCertificate * andre@0: STAN_GetNSSCertificate(CERTCertificate *c); andre@0: andre@0: NSS_EXTERN CERTCertTrust * andre@0: nssTrust_GetCERTCertTrustForCert(NSSCertificate *c, CERTCertificate *cc); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_DeleteCertTrustMatchingSlot(NSSCertificate *c); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust); andre@0: andre@0: NSS_EXTERN PRStatus andre@0: nssPKIX509_GetIssuerAndSerialFromDER(NSSDER *der, NSSArena *arena, andre@0: NSSDER *issuer, NSSDER *serial); andre@0: andre@0: NSS_EXTERN char * andre@0: STAN_GetCERTCertificateName(PLArenaPool *arenaOpt, NSSCertificate *c); andre@0: andre@0: NSS_EXTERN char * andre@0: STAN_GetCERTCertificateNameForInstance(PLArenaPool *arenaOpt, andre@0: NSSCertificate *c, andre@0: nssCryptokiInstance *instance); andre@0: andre@0: /* exposing this */ andre@0: NSS_EXTERN NSSCertificate * andre@0: NSSCertificate_Create andre@0: ( andre@0: NSSArena *arenaOpt andre@0: ); andre@0: andre@0: /* This function is being put here because it is a hack for andre@0: * PK11_FindCertFromNickname. andre@0: */ andre@0: NSS_EXTERN NSSCertificate * andre@0: nssTrustDomain_FindBestCertificateByNicknameForToken andre@0: ( andre@0: NSSTrustDomain *td, andre@0: NSSToken *token, andre@0: NSSUTF8 *name, andre@0: NSSTime *timeOpt, /* NULL for "now" */ andre@0: NSSUsage *usage, andre@0: NSSPolicies *policiesOpt /* NULL for none */ andre@0: ); andre@0: andre@0: /* This function is being put here because it is a hack for andre@0: * PK11_FindCertsFromNickname. andre@0: */ andre@0: NSS_EXTERN NSSCertificate ** andre@0: nssTrustDomain_FindCertificatesByNicknameForToken andre@0: ( andre@0: NSSTrustDomain *td, andre@0: NSSToken *token, andre@0: NSSUTF8 *name, andre@0: NSSCertificate *rvOpt[], andre@0: PRUint32 maximumOpt, /* 0 for no max */ andre@0: NSSArena *arenaOpt andre@0: ); andre@0: andre@0: /* CERT_TraversePermCertsForSubject */ andre@0: NSS_EXTERN PRStatus andre@0: nssTrustDomain_TraverseCertificatesBySubject andre@0: ( andre@0: NSSTrustDomain *td, andre@0: NSSDER *subject, andre@0: PRStatus (*callback)(NSSCertificate *c, void *arg), andre@0: void *arg andre@0: ); andre@0: andre@0: /* CERT_TraversePermCertsForNickname */ andre@0: NSS_EXTERN PRStatus andre@0: nssTrustDomain_TraverseCertificatesByNickname andre@0: ( andre@0: NSSTrustDomain *td, andre@0: NSSUTF8 *nickname, andre@0: PRStatus (*callback)(NSSCertificate *c, void *arg), andre@0: void *arg andre@0: ); andre@0: andre@0: /* SEC_TraversePermCerts */ andre@0: NSS_EXTERN PRStatus andre@0: nssTrustDomain_TraverseCertificates andre@0: ( andre@0: NSSTrustDomain *td, andre@0: PRStatus (*callback)(NSSCertificate *c, void *arg), andre@0: void *arg andre@0: ); andre@0: andre@0: /* CERT_AddTempCertToPerm */ andre@0: NSS_EXTERN PRStatus andre@0: nssTrustDomain_AddTempCertToPerm andre@0: ( andre@0: NSSCertificate *c andre@0: ); andre@0: andre@0: PR_END_EXTERN_C andre@0: andre@0: #endif /* PKINSS3HACK_H */