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 DEV_H michael@0: #include "dev.h" michael@0: #endif /* DEV_H */ michael@0: michael@0: #ifndef PKIM_H michael@0: #include "pkim.h" michael@0: #endif /* PKIM_H */ michael@0: michael@0: #ifndef PKISTORE_H michael@0: #include "pkistore.h" michael@0: #endif /* PKISTORE_H */ michael@0: michael@0: extern const NSSError NSS_ERROR_NOT_FOUND; michael@0: extern const NSSError NSS_ERROR_INVALID_ARGUMENT; michael@0: michael@0: NSS_IMPLEMENT NSSCryptoContext * michael@0: nssCryptoContext_Create ( michael@0: NSSTrustDomain *td, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: NSSArena *arena; michael@0: NSSCryptoContext *rvCC; michael@0: arena = NSSArena_Create(); michael@0: if (!arena) { michael@0: return NULL; michael@0: } michael@0: rvCC = nss_ZNEW(arena, NSSCryptoContext); michael@0: if (!rvCC) { michael@0: return NULL; michael@0: } michael@0: rvCC->td = td; michael@0: rvCC->arena = arena; michael@0: rvCC->certStore = nssCertificateStore_Create(rvCC->arena); michael@0: if (!rvCC->certStore) { michael@0: nssArena_Destroy(arena); michael@0: return NULL; michael@0: } michael@0: michael@0: return rvCC; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_Destroy ( michael@0: NSSCryptoContext *cc michael@0: ) michael@0: { michael@0: PRStatus status = PR_SUCCESS; michael@0: PORT_Assert(cc->certStore); michael@0: if (cc->certStore) { michael@0: status = nssCertificateStore_Destroy(cc->certStore); michael@0: if (status == PR_FAILURE) { michael@0: return status; michael@0: } michael@0: } else { michael@0: status = PR_FAILURE; michael@0: } michael@0: nssArena_Destroy(cc->arena); michael@0: return status; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_SetDefaultCallback ( michael@0: NSSCryptoContext *td, michael@0: NSSCallback *newCallback, michael@0: NSSCallback **oldCallbackOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCallback * michael@0: NSSCryptoContext_GetDefaultCallback ( michael@0: NSSCryptoContext *td, michael@0: PRStatus *statusOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSTrustDomain * michael@0: NSSCryptoContext_GetTrustDomain ( michael@0: NSSCryptoContext *td michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindOrImportCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSCertificate *c michael@0: ) michael@0: { michael@0: NSSCertificate *rvCert = NULL; michael@0: michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: nss_SetError(NSS_ERROR_INVALID_ARGUMENT); michael@0: return rvCert; michael@0: } michael@0: rvCert = nssCertificateStore_FindOrAdd(cc->certStore, c); michael@0: if (rvCert == c && c->object.cryptoContext != cc) { michael@0: PORT_Assert(!c->object.cryptoContext); michael@0: c->object.cryptoContext = cc; michael@0: } michael@0: if (rvCert) { michael@0: /* an NSSCertificate cannot be part of two crypto contexts michael@0: ** simultaneously. If this assertion fails, then there is michael@0: ** a serious Stan design flaw. michael@0: */ michael@0: PORT_Assert(cc == c->object.cryptoContext); michael@0: } michael@0: return rvCert; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_ImportPKIXCertificate ( michael@0: NSSCryptoContext *cc, michael@0: struct NSSPKIXCertificateStr *pc michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_ImportEncodedCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSBER *ber michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_ImportEncodedPKIXCertificateChain ( michael@0: NSSCryptoContext *cc, michael@0: NSSBER *ber michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: nssCryptoContext_ImportTrust ( michael@0: NSSCryptoContext *cc, michael@0: NSSTrust *trust michael@0: ) michael@0: { michael@0: PRStatus nssrv; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return PR_FAILURE; michael@0: } michael@0: nssrv = nssCertificateStore_AddTrust(cc->certStore, trust); michael@0: #if 0 michael@0: if (nssrv == PR_SUCCESS) { michael@0: trust->object.cryptoContext = cc; michael@0: } michael@0: #endif michael@0: return nssrv; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: nssCryptoContext_ImportSMIMEProfile ( michael@0: NSSCryptoContext *cc, michael@0: nssSMIMEProfile *profile michael@0: ) michael@0: { michael@0: PRStatus nssrv; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return PR_FAILURE; michael@0: } michael@0: nssrv = nssCertificateStore_AddSMIMEProfile(cc->certStore, profile); michael@0: #if 0 michael@0: if (nssrv == PR_SUCCESS) { michael@0: profile->object.cryptoContext = cc; michael@0: } michael@0: #endif michael@0: return nssrv; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestCertificateByNickname ( michael@0: NSSCryptoContext *cc, michael@0: const NSSUTF8 *name, michael@0: NSSTime *timeOpt, /* NULL for "now" */ michael@0: NSSUsage *usage, michael@0: NSSPolicies *policiesOpt /* NULL for none */ michael@0: ) michael@0: { michael@0: NSSCertificate **certs; michael@0: NSSCertificate *rvCert = NULL; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: certs = nssCertificateStore_FindCertificatesByNickname(cc->certStore, michael@0: name, michael@0: NULL, 0, NULL); michael@0: if (certs) { michael@0: rvCert = nssCertificateArray_FindBestCertificate(certs, michael@0: timeOpt, michael@0: usage, michael@0: policiesOpt); michael@0: nssCertificateArray_Destroy(certs); michael@0: } michael@0: return rvCert; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindCertificatesByNickname ( michael@0: NSSCryptoContext *cc, michael@0: NSSUTF8 *name, michael@0: NSSCertificate *rvOpt[], michael@0: PRUint32 maximumOpt, /* 0 for no max */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: NSSCertificate **rvCerts; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: rvCerts = nssCertificateStore_FindCertificatesByNickname(cc->certStore, michael@0: name, michael@0: rvOpt, michael@0: maximumOpt, michael@0: arenaOpt); michael@0: return rvCerts; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindCertificateByIssuerAndSerialNumber ( michael@0: NSSCryptoContext *cc, michael@0: NSSDER *issuer, michael@0: NSSDER *serialNumber michael@0: ) michael@0: { michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: return nssCertificateStore_FindCertificateByIssuerAndSerialNumber( michael@0: cc->certStore, michael@0: issuer, michael@0: serialNumber); michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestCertificateBySubject ( michael@0: NSSCryptoContext *cc, michael@0: NSSDER *subject, michael@0: NSSTime *timeOpt, michael@0: NSSUsage *usage, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: NSSCertificate **certs; michael@0: NSSCertificate *rvCert = NULL; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: certs = nssCertificateStore_FindCertificatesBySubject(cc->certStore, michael@0: subject, michael@0: NULL, 0, NULL); michael@0: if (certs) { michael@0: rvCert = nssCertificateArray_FindBestCertificate(certs, michael@0: timeOpt, michael@0: usage, michael@0: policiesOpt); michael@0: nssCertificateArray_Destroy(certs); michael@0: } michael@0: return rvCert; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: nssCryptoContext_FindCertificatesBySubject ( michael@0: NSSCryptoContext *cc, michael@0: NSSDER *subject, michael@0: NSSCertificate *rvOpt[], michael@0: PRUint32 maximumOpt, /* 0 for no max */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: NSSCertificate **rvCerts; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: rvCerts = nssCertificateStore_FindCertificatesBySubject(cc->certStore, michael@0: subject, michael@0: rvOpt, michael@0: maximumOpt, michael@0: arenaOpt); michael@0: return rvCerts; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindCertificatesBySubject ( michael@0: NSSCryptoContext *cc, michael@0: NSSDER *subject, michael@0: NSSCertificate *rvOpt[], michael@0: PRUint32 maximumOpt, /* 0 for no max */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: return nssCryptoContext_FindCertificatesBySubject(cc, subject, michael@0: rvOpt, maximumOpt, michael@0: arenaOpt); michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestCertificateByNameComponents ( michael@0: NSSCryptoContext *cc, michael@0: NSSUTF8 *nameComponents, michael@0: NSSTime *timeOpt, michael@0: NSSUsage *usage, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindCertificatesByNameComponents ( michael@0: NSSCryptoContext *cc, michael@0: NSSUTF8 *nameComponents, michael@0: NSSCertificate *rvOpt[], michael@0: PRUint32 maximumOpt, /* 0 for no max */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindCertificateByEncodedCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSBER *encodedCertificate michael@0: ) michael@0: { michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: return nssCertificateStore_FindCertificateByEncodedCertificate( michael@0: cc->certStore, michael@0: encodedCertificate); michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestCertificateByEmail ( michael@0: NSSCryptoContext *cc, michael@0: NSSASCII7 *email, michael@0: NSSTime *timeOpt, michael@0: NSSUsage *usage, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: NSSCertificate **certs; michael@0: NSSCertificate *rvCert = NULL; michael@0: michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: certs = nssCertificateStore_FindCertificatesByEmail(cc->certStore, michael@0: email, michael@0: NULL, 0, NULL); michael@0: if (certs) { michael@0: rvCert = nssCertificateArray_FindBestCertificate(certs, michael@0: timeOpt, michael@0: usage, michael@0: policiesOpt); michael@0: nssCertificateArray_Destroy(certs); michael@0: } michael@0: return rvCert; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindCertificatesByEmail ( michael@0: NSSCryptoContext *cc, michael@0: NSSASCII7 *email, michael@0: NSSCertificate *rvOpt[], michael@0: PRUint32 maximumOpt, /* 0 for no max */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: NSSCertificate **rvCerts; michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: rvCerts = nssCertificateStore_FindCertificatesByEmail(cc->certStore, michael@0: email, michael@0: rvOpt, michael@0: maximumOpt, michael@0: arenaOpt); michael@0: return rvCerts; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindCertificateByOCSPHash ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *hash michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestUserCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSTime *timeOpt, michael@0: NSSUsage *usage, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindUserCertificates ( michael@0: NSSCryptoContext *cc, michael@0: NSSTime *timeOpt, michael@0: NSSUsage *usageOpt, michael@0: NSSPolicies *policiesOpt, michael@0: NSSCertificate **rvOpt, michael@0: PRUint32 rvLimit, /* zero for no limit */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestUserCertificateForSSLClientAuth ( michael@0: NSSCryptoContext *cc, michael@0: NSSUTF8 *sslHostOpt, michael@0: NSSDER *rootCAsOpt[], /* null pointer for none */ michael@0: PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */ michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate ** michael@0: NSSCryptoContext_FindUserCertificatesForSSLClientAuth ( michael@0: NSSCryptoContext *cc, michael@0: NSSUTF8 *sslHostOpt, michael@0: NSSDER *rootCAsOpt[], /* null pointer for none */ michael@0: PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */ michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSPolicies *policiesOpt, michael@0: NSSCertificate **rvOpt, michael@0: PRUint32 rvLimit, /* zero for no limit */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindBestUserCertificateForEmailSigning ( michael@0: NSSCryptoContext *cc, michael@0: NSSASCII7 *signerOpt, michael@0: NSSASCII7 *recipientOpt, michael@0: /* anything more here? */ michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSPolicies *policiesOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCertificate * michael@0: NSSCryptoContext_FindUserCertificatesForEmailSigning ( michael@0: NSSCryptoContext *cc, michael@0: NSSASCII7 *signerOpt, /* fgmr or a more general name? */ michael@0: NSSASCII7 *recipientOpt, michael@0: /* anything more here? */ michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSPolicies *policiesOpt, michael@0: NSSCertificate **rvOpt, michael@0: PRUint32 rvLimit, /* zero for no limit */ michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSTrust * michael@0: nssCryptoContext_FindTrustForCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSCertificate *cert michael@0: ) michael@0: { michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: return nssCertificateStore_FindTrustForCertificate(cc->certStore, cert); michael@0: } michael@0: michael@0: NSS_IMPLEMENT nssSMIMEProfile * michael@0: nssCryptoContext_FindSMIMEProfileForCertificate ( michael@0: NSSCryptoContext *cc, michael@0: NSSCertificate *cert michael@0: ) michael@0: { michael@0: PORT_Assert(cc->certStore); michael@0: if (!cc->certStore) { michael@0: return NULL; michael@0: } michael@0: return nssCertificateStore_FindSMIMEProfileForCertificate(cc->certStore, michael@0: cert); michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_GenerateKeyPair ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *ap, michael@0: NSSPrivateKey **pvkOpt, michael@0: NSSPublicKey **pbkOpt, michael@0: PRBool privateKeyIsSensitive, michael@0: NSSToken *destination, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSSymmetricKey * michael@0: NSSCryptoContext_GenerateSymmetricKey ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *ap, michael@0: PRUint32 keysize, michael@0: NSSToken *destination, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSSymmetricKey * michael@0: NSSCryptoContext_GenerateSymmetricKeyFromPassword ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *ap, michael@0: NSSUTF8 *passwordOpt, /* if null, prompt */ michael@0: NSSToken *destinationOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSSymmetricKey * michael@0: NSSCryptoContext_FindSymmetricKeyByAlgorithmAndKeyID ( michael@0: NSSCryptoContext *cc, michael@0: NSSOID *algorithm, michael@0: NSSItem *keyID, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: struct token_session_str { michael@0: NSSToken *token; michael@0: nssSession *session; michael@0: }; michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_Decrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *encryptedData, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginDecrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_ContinueDecrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishDecrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_Sign ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *data, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginSign ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_ContinueSign ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishSign ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_SignRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *data, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginSignRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_ContinueSignRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishSignRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSSymmetricKey * michael@0: NSSCryptoContext_UnwrapSymmetricKey ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *wrappedKey, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSSymmetricKey * michael@0: NSSCryptoContext_DeriveSymmetricKey ( michael@0: NSSCryptoContext *cc, michael@0: NSSPublicKey *bk, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSOID *target, michael@0: PRUint32 keySizeOpt, /* zero for best allowed */ michael@0: NSSOperations operations, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_Encrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *data, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginEncrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_ContinueEncrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishEncrypt ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_Verify ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *data, michael@0: NSSItem *signature, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginVerify ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *signature, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_ContinueVerify ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_FinishVerify ( michael@0: NSSCryptoContext *cc michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_VerifyRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *signature, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginVerifyRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_ContinueVerifyRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *data, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishVerifyRecover ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_WrapSymmetricKey ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSSymmetricKey *keyToWrap, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_Digest ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *data, michael@0: NSSCallback *uhhOpt, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: return nssToken_Digest(cc->token, cc->session, apOpt, michael@0: data, rvOpt, arenaOpt); michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_BeginDigest ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSCallback *uhhOpt michael@0: ) michael@0: { michael@0: return nssToken_BeginDigest(cc->token, cc->session, apOpt); michael@0: } michael@0: michael@0: NSS_IMPLEMENT PRStatus michael@0: NSSCryptoContext_ContinueDigest ( michael@0: NSSCryptoContext *cc, michael@0: NSSAlgorithmAndParameters *apOpt, michael@0: NSSItem *item michael@0: ) michael@0: { michael@0: /* michael@0: NSSAlgorithmAndParameters *ap; michael@0: ap = (apOpt) ? apOpt : cc->ap; michael@0: */ michael@0: /* why apOpt? can't change it at this point... */ michael@0: return nssToken_ContinueDigest(cc->token, cc->session, item); michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSItem * michael@0: NSSCryptoContext_FinishDigest ( michael@0: NSSCryptoContext *cc, michael@0: NSSItem *rvOpt, michael@0: NSSArena *arenaOpt michael@0: ) michael@0: { michael@0: return nssToken_FinishDigest(cc->token, cc->session, rvOpt, arenaOpt); michael@0: } michael@0: michael@0: NSS_IMPLEMENT NSSCryptoContext * michael@0: NSSCryptoContext_Clone ( michael@0: NSSCryptoContext *cc michael@0: ) michael@0: { michael@0: nss_SetError(NSS_ERROR_NOT_FOUND); michael@0: return NULL; michael@0: } michael@0: