2001-07-20 00:41:38 +04:00
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Netscape security libraries.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the
|
|
|
|
* terms of the GNU General Public License Version 2 or later (the
|
|
|
|
* "GPL"), in which case the provisions of the GPL are applicable
|
|
|
|
* instead of those above. If you wish to allow use of your
|
|
|
|
* version of this file only under the terms of the GPL and not to
|
|
|
|
* allow others to use your version of this file under the MPL,
|
|
|
|
* indicate your decision by deleting the provisions above and
|
|
|
|
* replace them with the notice and other provisions required by
|
|
|
|
* the GPL. If you do not delete the provisions above, a recipient
|
|
|
|
* may use your version of this file under either the MPL or the
|
|
|
|
* GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
2001-09-20 01:49:52 +04:00
|
|
|
static const char CVS_ID[] = "@(#) $RCSfile: trustdomain.c,v $ $Revision: 1.4 $ $Date: 2001-09-19 21:49:52 $ $Name: $";
|
2001-07-20 00:41:38 +04:00
|
|
|
#endif /* DEBUG */
|
|
|
|
|
|
|
|
#ifndef NSSPKI_H
|
|
|
|
#include "nsspki.h"
|
|
|
|
#endif /* NSSPKI_H */
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
#ifndef PKIT_H
|
|
|
|
#include "pkit.h"
|
|
|
|
#endif /* PKIT_H */
|
|
|
|
|
|
|
|
#ifndef DEV_H
|
|
|
|
#include "dev.h"
|
|
|
|
#endif /* DEV_H */
|
|
|
|
|
2001-09-20 01:49:52 +04:00
|
|
|
#ifndef CKHELPER_H
|
|
|
|
#include "ckhelper.h"
|
|
|
|
#endif /* CKHELPER_H */
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSTrustDomain *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_Create
|
|
|
|
(
|
|
|
|
NSSUTF8 *moduleOpt,
|
|
|
|
NSSUTF8 *uriOpt,
|
|
|
|
NSSUTF8 *opaqueOpt,
|
|
|
|
void *reserved
|
|
|
|
)
|
|
|
|
{
|
2001-09-14 02:16:22 +04:00
|
|
|
NSSArena *arena;
|
|
|
|
NSSTrustDomain *rvTD;
|
|
|
|
arena = NSSArena_Create();
|
|
|
|
if(!arena) {
|
|
|
|
return (NSSTrustDomain *)NULL;
|
|
|
|
}
|
|
|
|
rvTD = nss_ZNEW(arena, NSSTrustDomain);
|
|
|
|
if (!rvTD) {
|
|
|
|
nssArena_Destroy(arena);
|
|
|
|
return (NSSTrustDomain *)NULL;
|
|
|
|
}
|
|
|
|
rvTD->arena = arena;
|
2001-09-19 00:55:01 +04:00
|
|
|
rvTD->refCount = 1;
|
2001-09-14 02:16:22 +04:00
|
|
|
return rvTD;
|
2001-07-20 00:41:38 +04:00
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_Destroy
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td
|
|
|
|
)
|
|
|
|
{
|
2001-09-19 00:55:01 +04:00
|
|
|
if (--td->refCount == 0) {
|
2001-09-20 01:49:52 +04:00
|
|
|
nssModule_Destroy(td->module);
|
2001-09-19 00:55:01 +04:00
|
|
|
nssArena_Destroy(td->arena);
|
|
|
|
}
|
|
|
|
return PR_SUCCESS;
|
2001-07-20 00:41:38 +04:00
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_SetDefaultCallback
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSCallback *newCallback,
|
|
|
|
NSSCallback **oldCallbackOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCallback *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_GetDefaultCallback
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
PRStatus *statusOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_LoadModule
|
|
|
|
(
|
2001-09-14 02:16:22 +04:00
|
|
|
NSSTrustDomain *td,
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSUTF8 *moduleOpt,
|
|
|
|
NSSUTF8 *uriOpt,
|
|
|
|
NSSUTF8 *opaqueOpt,
|
|
|
|
void *reserved
|
|
|
|
)
|
|
|
|
{
|
2001-09-14 02:16:22 +04:00
|
|
|
NSSModule *module;
|
|
|
|
/* This is really just here for testing. I don't presume that it is
|
|
|
|
* correct. Therefore, I won't comment further.
|
|
|
|
*/
|
|
|
|
if (moduleOpt) {
|
2001-09-20 01:49:52 +04:00
|
|
|
module = nssModule_Create(moduleOpt, uriOpt, opaqueOpt, reserved);
|
|
|
|
nssModule_Load(module);
|
2001-09-14 02:16:22 +04:00
|
|
|
td->module = module;
|
|
|
|
#ifdef DEBUG
|
2001-09-20 01:49:52 +04:00
|
|
|
nssModule_Debug(td->module);
|
2001-09-14 02:16:22 +04:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
return PR_SUCCESS;
|
2001-07-20 00:41:38 +04:00
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_DisableToken
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSToken *token,
|
|
|
|
NSSError why
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_EnableToken
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSToken *token
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_IsTokenEnabled
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSToken *token,
|
|
|
|
NSSError *whyOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSSlot *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindSlotByName
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *slotName
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSToken *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindTokenByName
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *tokenName
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSToken *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindTokenBySlotName
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *slotName
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSToken *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindTokenForAlgorithm
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSOID *algorithm
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSToken *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestTokenForAlgorithms
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSOID *algorithms[], /* may be null-terminated */
|
|
|
|
PRUint32 nAlgorithmsOpt /* limits the array if nonzero */
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_Login
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_Logout
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportCertificate
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSCertificate *c
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportPKIXCertificate
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
/* declared as a struct until these "data types" are defined */
|
|
|
|
struct NSSPKIXCertificateStr *pc
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportEncodedCertificate
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSBER *ber
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportEncodedCertificateChain
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSBER *ber,
|
|
|
|
NSSCertificate *rvOpt[],
|
|
|
|
PRUint32 maximumOpt, /* 0 for no max */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSPrivateKey *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportEncodedPrivateKey
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSBER *ber,
|
|
|
|
NSSItem *passwordOpt, /* NULL will cause a callback */
|
|
|
|
NSSCallback *uhhOpt,
|
|
|
|
NSSToken *destination
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSPublicKey *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_ImportEncodedPublicKey
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSBER *ber
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestCertificateByNickname
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *name,
|
|
|
|
NSSTime *timeOpt, /* NULL for "now" */
|
|
|
|
NSSUsage *usage,
|
|
|
|
NSSPolicies *policiesOpt /* NULL for none */
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-20 01:49:52 +04:00
|
|
|
/* THIS IS A TEST IMPLEMENTATION ONLY */
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificatesByNickname
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *name,
|
|
|
|
NSSCertificate *rvOpt[],
|
|
|
|
PRUint32 maximumOpt, /* 0 for no max */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
2001-09-20 01:49:52 +04:00
|
|
|
PRStatus nssrv;
|
|
|
|
NSSCertificate **certs;
|
|
|
|
NSSToken *tok = td->module->slots[0]->token;
|
|
|
|
CK_ATTRIBUTE cert_template[] =
|
|
|
|
{
|
|
|
|
{ CKA_CLASS, g_ck_class_cert.data, g_ck_class_cert.size },
|
|
|
|
{ CKA_LABEL, NULL, 0 }
|
|
|
|
};
|
|
|
|
CK_ULONG ctsize;
|
|
|
|
ctsize = (CK_ULONG)(sizeof(cert_template) / sizeof(cert_template[0]));
|
|
|
|
cert_template[1].pValue = (CK_VOID_PTR)name;
|
|
|
|
cert_template[1].ulValueLen = (CK_ULONG)nssUTF8_Length(name, &nssrv);
|
|
|
|
certs = nssToken_FindCertificatesByTemplate(tok, NULL, NULL, 0, NULL,
|
|
|
|
cert_template, ctsize);
|
|
|
|
if (!certs) {
|
|
|
|
cert_template[1].ulValueLen++;
|
|
|
|
certs = nssToken_FindCertificatesByTemplate(tok, NULL, NULL, 0, NULL,
|
|
|
|
cert_template, ctsize);
|
|
|
|
}
|
|
|
|
return certs;
|
2001-07-20 00:41:38 +04:00
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificateByIssuerAndSerialNumber
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSDER *issuer,
|
|
|
|
NSSDER *serialNumber
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestCertificateBySubject
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *subject,
|
|
|
|
NSSTime *timeOpt,
|
|
|
|
NSSUsage *usage,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificatesBySubject
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *subject,
|
|
|
|
NSSCertificate *rvOpt[],
|
|
|
|
PRUint32 maximumOpt, /* 0 for no max */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestCertificateByNameComponents
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *nameComponents,
|
|
|
|
NSSTime *timeOpt,
|
|
|
|
NSSUsage *usage,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificatesByNameComponents
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *nameComponents,
|
|
|
|
NSSCertificate *rvOpt[],
|
|
|
|
PRUint32 maximumOpt, /* 0 for no max */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificateByEncodedCertificate
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSBER *encodedCertificate
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificateByEmail
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSASCII7 *email,
|
|
|
|
NSSTime *timeOpt,
|
|
|
|
NSSUsage *usage,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificatesByEmail
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSASCII7 *email,
|
|
|
|
NSSCertificate *rvOpt[],
|
|
|
|
PRUint32 maximumOpt, /* 0 for no max */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindCertificateByOCSPHash
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSItem *hash
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestUserCertificate
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSTime *timeOpt,
|
|
|
|
NSSUsage *usage,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindUserCertificates
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSTime *timeOpt,
|
|
|
|
NSSUsage *usageOpt,
|
|
|
|
NSSPolicies *policiesOpt,
|
|
|
|
NSSCertificate **rvOpt,
|
|
|
|
PRUint32 rvLimit, /* zero for no limit */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestUserCertificateForSSLClientAuth
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *sslHostOpt,
|
|
|
|
NSSDER *rootCAsOpt[], /* null pointer for none */
|
|
|
|
PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */
|
|
|
|
NSSAlgorithmAndParameters *apOpt,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindUserCertificatesForSSLClientAuth
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSUTF8 *sslHostOpt,
|
|
|
|
NSSDER *rootCAsOpt[], /* null pointer for none */
|
|
|
|
PRUint32 rootCAsMaxOpt, /* zero means list is null-terminated */
|
|
|
|
NSSAlgorithmAndParameters *apOpt,
|
|
|
|
NSSPolicies *policiesOpt,
|
|
|
|
NSSCertificate **rvOpt,
|
|
|
|
PRUint32 rvLimit, /* zero for no limit */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindBestUserCertificateForEmailSigning
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSASCII7 *signerOpt,
|
|
|
|
NSSASCII7 *recipientOpt,
|
|
|
|
/* anything more here? */
|
|
|
|
NSSAlgorithmAndParameters *apOpt,
|
|
|
|
NSSPolicies *policiesOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCertificate **
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindUserCertificatesForEmailSigning
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSASCII7 *signerOpt,
|
|
|
|
NSSASCII7 *recipientOpt,
|
|
|
|
/* anything more here? */
|
|
|
|
NSSAlgorithmAndParameters *apOpt,
|
|
|
|
NSSPolicies *policiesOpt,
|
|
|
|
NSSCertificate **rvOpt,
|
|
|
|
PRUint32 rvLimit, /* zero for no limit */
|
|
|
|
NSSArena *arenaOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
2001-09-14 02:16:22 +04:00
|
|
|
|
|
|
|
NSS_IMPLEMENT PRStatus *
|
|
|
|
NSSTrustDomain_TraverseCertificates
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
PRStatus (*callback)(NSSCertificate *c, void *arg),
|
|
|
|
void *arg
|
|
|
|
)
|
|
|
|
{
|
|
|
|
/* Do module->slot->token, or just slotarray->tokens? */
|
2001-09-20 01:49:52 +04:00
|
|
|
return nssModule_TraverseCertificates(td->module, callback, arg);
|
2001-09-14 02:16:22 +04:00
|
|
|
}
|
2001-07-20 00:41:38 +04:00
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT PRStatus
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_GenerateKeyPair
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSAlgorithmAndParameters *ap,
|
|
|
|
NSSPrivateKey **pvkOpt,
|
|
|
|
NSSPublicKey **pbkOpt,
|
|
|
|
PRBool privateKeyIsSensitive,
|
|
|
|
NSSToken *destination,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return PR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSSymmetricKey *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_GenerateSymmetricKey
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSAlgorithmAndParameters *ap,
|
|
|
|
PRUint32 keysize,
|
|
|
|
NSSToken *destination,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSSymmetricKey *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_GenerateSymmetricKeyFromPassword
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSAlgorithmAndParameters *ap,
|
|
|
|
NSSUTF8 *passwordOpt, /* if null, prompt */
|
|
|
|
NSSToken *destinationOpt,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSSymmetricKey *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_FindSymmetricKeyByAlgorithmAndKeyID
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSOID *algorithm,
|
|
|
|
NSSItem *keyID,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCryptoContext *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_CreateCryptoContext
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSCallback *uhhOpt
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCryptoContext *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_CreateCryptoContextForAlgorithm
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSOID *algorithm
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-14 02:16:22 +04:00
|
|
|
NSS_IMPLEMENT NSSCryptoContext *
|
2001-07-20 00:41:38 +04:00
|
|
|
NSSTrustDomain_CreateCryptoContextForAlgorithmAndParameters
|
|
|
|
(
|
|
|
|
NSSTrustDomain *td,
|
|
|
|
NSSAlgorithmAndParameters *ap
|
|
|
|
)
|
|
|
|
{
|
|
|
|
nss_SetError(NSS_ERROR_NOT_FOUND);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|