Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
cryptocontext.c File Reference
#include "dev.h"
#include "pkim.h"
#include "pkistore.h"
#include "pki1t.h"

Go to the source code of this file.

Classes

struct  token_session_str

Functions

NSS_IMPLEMENT NSSCryptoContext * nssCryptoContext_Create (NSSTrustDomain *td, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_Destroy (NSSCryptoContext *cc)
NSS_IMPLEMENT PRStatus NSSCryptoContext_SetDefaultCallback (NSSCryptoContext *td, NSSCallback *newCallback, NSSCallback **oldCallbackOpt)
NSS_IMPLEMENT NSSCallback * NSSCryptoContext_GetDefaultCallback (NSSCryptoContext *td, PRStatus *statusOpt)
NSS_IMPLEMENT NSSTrustDomain * NSSCryptoContext_GetTrustDomain (NSSCryptoContext *td)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindOrImportCertificate (NSSCryptoContext *cc, NSSCertificate *c)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_ImportPKIXCertificate (NSSCryptoContext *cc, struct NSSPKIXCertificateStr *pc)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_ImportEncodedCertificate (NSSCryptoContext *cc, NSSBER *ber)
NSS_IMPLEMENT PRStatus NSSCryptoContext_ImportEncodedPKIXCertificateChain (NSSCryptoContext *cc, NSSBER *ber)
NSS_IMPLEMENT PRStatus nssCryptoContext_ImportTrust (NSSCryptoContext *cc, NSSTrust *trust)
NSS_IMPLEMENT PRStatus nssCryptoContext_ImportSMIMEProfile (NSSCryptoContext *cc, nssSMIMEProfile *profile)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestCertificateByNickname (NSSCryptoContext *cc, NSSUTF8 *name, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindCertificatesByNickname (NSSCryptoContext *cc, NSSUTF8 *name, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindCertificateByIssuerAndSerialNumber (NSSCryptoContext *cc, NSSDER *issuer, NSSDER *serialNumber)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestCertificateBySubject (NSSCryptoContext *cc, NSSDER *subject, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** nssCryptoContext_FindCertificatesBySubject (NSSCryptoContext *cc, NSSDER *subject, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindCertificatesBySubject (NSSCryptoContext *cc, NSSDER *subject, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestCertificateByNameComponents (NSSCryptoContext *cc, NSSUTF8 *nameComponents, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindCertificatesByNameComponents (NSSCryptoContext *cc, NSSUTF8 *nameComponents, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindCertificateByEncodedCertificate (NSSCryptoContext *cc, NSSBER *encodedCertificate)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestCertificateByEmail (NSSCryptoContext *cc, NSSASCII7 *email, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindCertificatesByEmail (NSSCryptoContext *cc, NSSASCII7 *email, NSSCertificate *rvOpt[], PRUint32 maximumOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindCertificateByOCSPHash (NSSCryptoContext *cc, NSSItem *hash)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestUserCertificate (NSSCryptoContext *cc, NSSTime *timeOpt, NSSUsage *usage, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindUserCertificates (NSSCryptoContext *cc, NSSTime *timeOpt, NSSUsage *usageOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestUserCertificateForSSLClientAuth (NSSCryptoContext *cc, NSSUTF8 *sslHostOpt, NSSDER *rootCAsOpt[], PRUint32 rootCAsMaxOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate ** NSSCryptoContext_FindUserCertificatesForSSLClientAuth (NSSCryptoContext *cc, NSSUTF8 *sslHostOpt, NSSDER *rootCAsOpt[], PRUint32 rootCAsMaxOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindBestUserCertificateForEmailSigning (NSSCryptoContext *cc, NSSASCII7 *signerOpt, NSSASCII7 *recipientOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt)
NSS_IMPLEMENT NSSCertificate * NSSCryptoContext_FindUserCertificatesForEmailSigning (NSSCryptoContext *cc, NSSASCII7 *signerOpt, NSSASCII7 *recipientOpt, NSSAlgorithmAndParameters *apOpt, NSSPolicies *policiesOpt, NSSCertificate **rvOpt, PRUint32 rvLimit, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSTrust * nssCryptoContext_FindTrustForCertificate (NSSCryptoContext *cc, NSSCertificate *cert)
NSS_IMPLEMENT nssSMIMEProfile * nssCryptoContext_FindSMIMEProfileForCertificate (NSSCryptoContext *cc, NSSCertificate *cert)
NSS_IMPLEMENT PRStatus NSSCryptoContext_GenerateKeyPair (NSSCryptoContext *cc, NSSAlgorithmAndParameters *ap, NSSPrivateKey **pvkOpt, NSSPublicKey **pbkOpt, PRBool privateKeyIsSensitive, NSSToken *destination, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSCryptoContext_GenerateSymmetricKey (NSSCryptoContext *cc, NSSAlgorithmAndParameters *ap, PRUint32 keysize, NSSToken *destination, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSCryptoContext_GenerateSymmetricKeyFromPassword (NSSCryptoContext *cc, NSSAlgorithmAndParameters *ap, NSSUTF8 *passwordOpt, NSSToken *destinationOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSCryptoContext_FindSymmetricKeyByAlgorithmAndKeyID (NSSCryptoContext *cc, NSSOID *algorithm, NSSItem *keyID, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_Decrypt (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *encryptedData, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginDecrypt (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_ContinueDecrypt (NSSCryptoContext *cc, NSSItem *data, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishDecrypt (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_Sign (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *data, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginSign (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueSign (NSSCryptoContext *cc, NSSItem *data)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishSign (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_SignRecover (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *data, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginSignRecover (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_ContinueSignRecover (NSSCryptoContext *cc, NSSItem *data, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishSignRecover (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSCryptoContext_UnwrapSymmetricKey (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *wrappedKey, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSSymmetricKey * NSSCryptoContext_DeriveSymmetricKey (NSSCryptoContext *cc, NSSPublicKey *bk, NSSAlgorithmAndParameters *apOpt, NSSOID *target, PRUint32 keySizeOpt, NSSOperations operations, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_Encrypt (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *data, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginEncrypt (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_ContinueEncrypt (NSSCryptoContext *cc, NSSItem *data, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishEncrypt (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_Verify (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *data, NSSItem *signature, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginVerify (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *signature, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueVerify (NSSCryptoContext *cc, NSSItem *data)
NSS_IMPLEMENT PRStatus NSSCryptoContext_FinishVerify (NSSCryptoContext *cc)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_VerifyRecover (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *signature, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginVerifyRecover (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_ContinueVerifyRecover (NSSCryptoContext *cc, NSSItem *data, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishVerifyRecover (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_WrapSymmetricKey (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSSymmetricKey *keyToWrap, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_Digest (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *data, NSSCallback *uhhOpt, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginDigest (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSCallback *uhhOpt)
NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueDigest (NSSCryptoContext *cc, NSSAlgorithmAndParameters *apOpt, NSSItem *item)
NSS_IMPLEMENT NSSItem * NSSCryptoContext_FinishDigest (NSSCryptoContext *cc, NSSItem *rvOpt, NSSArena *arenaOpt)
NSS_IMPLEMENT NSSCryptoContext * NSSCryptoContext_Clone (NSSCryptoContext *cc)

Variables

const NSSError NSS_ERROR_NOT_FOUND
const NSSError NSS_ERROR_INVALID_ARGUMENT

Class Documentation

struct token_session_str

Definition at line 635 of file cryptocontext.c.

Class Members
nssSession * session
NSSToken * token

Function Documentation

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginDecrypt ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 667 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginDigest ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 990 of file cryptocontext.c.

{
    return nssToken_BeginDigest(cc->token, cc->session, apOpt);
}

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginEncrypt ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 836 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginSign ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 715 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginSignRecover ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 761 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginVerify ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  signature,
NSSCallback *  uhhOpt 
)

Definition at line 883 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_BeginVerifyRecover ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSCallback *  uhhOpt 
)

Definition at line 928 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCryptoContext* NSSCryptoContext_Clone ( NSSCryptoContext *  cc)

Definition at line 1025 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_ContinueDecrypt ( NSSCryptoContext *  cc,
NSSItem *  data,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 678 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueDigest ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  item 
)

Definition at line 1000 of file cryptocontext.c.

{
       /*
    NSSAlgorithmAndParameters *ap;
    ap = (apOpt) ? apOpt : cc->ap;
    */
       /* why apOpt?  can't change it at this point... */
    return nssToken_ContinueDigest(cc->token, cc->session, item);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_ContinueEncrypt ( NSSCryptoContext *  cc,
NSSItem *  data,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 847 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueSign ( NSSCryptoContext *  cc,
NSSItem *  data 
)

Definition at line 726 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_ContinueSignRecover ( NSSCryptoContext *  cc,
NSSItem *  data,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 772 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_ContinueVerify ( NSSCryptoContext *  cc,
NSSItem *  data 
)

Definition at line 895 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_ContinueVerifyRecover ( NSSCryptoContext *  cc,
NSSItem *  data,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 939 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCryptoContext* nssCryptoContext_Create ( NSSTrustDomain *  td,
NSSCallback *  uhhOpt 
)

Definition at line 71 of file cryptocontext.c.

{
    NSSArena *arena;
    NSSCryptoContext *rvCC;
    arena = NSSArena_Create();
    if (!arena) {
       return NULL;
    }
    rvCC = nss_ZNEW(arena, NSSCryptoContext);
    if (!rvCC) {
       return NULL;
    }
    rvCC->td = td;
    rvCC->arena = arena;
    rvCC->certStore = nssCertificateStore_Create(rvCC->arena);
    if (!rvCC->certStore) {
       nssArena_Destroy(arena);
       return NULL;
    }

    return rvCC;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_Decrypt ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  encryptedData,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 653 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSSymmetricKey* NSSCryptoContext_DeriveSymmetricKey ( NSSCryptoContext *  cc,
NSSPublicKey *  bk,
NSSAlgorithmAndParameters *  apOpt,
NSSOID *  target,
PRUint32  keySizeOpt,
NSSOperations  operations,
NSSCallback *  uhhOpt 
)

Definition at line 807 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_Destroy ( NSSCryptoContext *  cc)

Definition at line 98 of file cryptocontext.c.

{
    PRStatus status = PR_SUCCESS;
    PORT_Assert(cc->certStore);
    if (cc->certStore) {
       status = nssCertificateStore_Destroy(cc->certStore);
       if (status == PR_FAILURE) {
           return status;
       }
    } else {
       status = PR_FAILURE;
    }
    nssArena_Destroy(cc->arena);
    return status;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_Digest ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  data,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 976 of file cryptocontext.c.

{
    return nssToken_Digest(cc->token, cc->session, apOpt, 
                           data, rvOpt, arenaOpt);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_Encrypt ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  data,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 822 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestCertificateByEmail ( NSSCryptoContext *  cc,
NSSASCII7 email,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 418 of file cryptocontext.c.

{
    NSSCertificate **certs;
    NSSCertificate *rvCert = NULL;

    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    certs = nssCertificateStore_FindCertificatesByEmail(cc->certStore,
                                                        email,
                                                        NULL, 0, NULL);
    if (certs) {
       rvCert = nssCertificateArray_FindBestCertificate(certs,
                                                        timeOpt,
                                                        usage,
                                                        policiesOpt);
       nssCertificateArray_Destroy(certs);
    }
    return rvCert;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestCertificateByNameComponents ( NSSCryptoContext *  cc,
NSSUTF8 nameComponents,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 377 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestCertificateByNickname ( NSSCryptoContext *  cc,
NSSUTF8 name,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 246 of file cryptocontext.c.

{
    NSSCertificate **certs;
    NSSCertificate *rvCert = NULL;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    certs = nssCertificateStore_FindCertificatesByNickname(cc->certStore,
                                                           name,
                                                           NULL, 0, NULL);
    if (certs) {
       rvCert = nssCertificateArray_FindBestCertificate(certs,
                                                        timeOpt,
                                                        usage,
                                                        policiesOpt);
       nssCertificateArray_Destroy(certs);
    }
    return rvCert;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestCertificateBySubject ( NSSCryptoContext *  cc,
NSSDER subject,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 313 of file cryptocontext.c.

{
    NSSCertificate **certs;
    NSSCertificate *rvCert = NULL;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    certs = nssCertificateStore_FindCertificatesBySubject(cc->certStore,
                                                          subject,
                                                          NULL, 0, NULL);
    if (certs) {
       rvCert = nssCertificateArray_FindBestCertificate(certs,
                                                        timeOpt,
                                                        usage,
                                                        policiesOpt);
       nssCertificateArray_Destroy(certs);
    }
    return rvCert;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestUserCertificate ( NSSCryptoContext *  cc,
NSSTime *  timeOpt,
NSSUsage *  usage,
NSSPolicies *  policiesOpt 
)

Definition at line 479 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestUserCertificateForEmailSigning ( NSSCryptoContext *  cc,
NSSASCII7 signerOpt,
NSSASCII7 recipientOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt 
)

Definition at line 537 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindBestUserCertificateForSSLClientAuth ( NSSCryptoContext *  cc,
NSSUTF8 sslHostOpt,
NSSDER rootCAsOpt[],
PRUint32  rootCAsMaxOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt 
)

Definition at line 506 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindCertificateByEncodedCertificate ( NSSCryptoContext *  cc,
NSSBER encodedCertificate 
)

Definition at line 403 of file cryptocontext.c.

{
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    return nssCertificateStore_FindCertificateByEncodedCertificate(
                                                           cc->certStore,
                                                           encodedCertificate);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindCertificateByIssuerAndSerialNumber ( NSSCryptoContext *  cc,
NSSDER issuer,
NSSDER serialNumber 
)

Definition at line 296 of file cryptocontext.c.

{
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    return nssCertificateStore_FindCertificateByIssuerAndSerialNumber(
                                                               cc->certStore,
                                                               issuer,
                                                               serialNumber);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindCertificateByOCSPHash ( NSSCryptoContext *  cc,
NSSItem *  hash 
)

Definition at line 469 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindCertificatesByEmail ( NSSCryptoContext *  cc,
NSSASCII7 email,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 447 of file cryptocontext.c.

{
    NSSCertificate **rvCerts;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    rvCerts = nssCertificateStore_FindCertificatesByEmail(cc->certStore,
                                                          email,
                                                          rvOpt,
                                                          maximumOpt,
                                                          arenaOpt);
    return rvCerts;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindCertificatesByNameComponents ( NSSCryptoContext *  cc,
NSSUTF8 nameComponents,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 390 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindCertificatesByNickname ( NSSCryptoContext *  cc,
NSSUTF8 name,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 274 of file cryptocontext.c.

{
    NSSCertificate **rvCerts;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    rvCerts = nssCertificateStore_FindCertificatesByNickname(cc->certStore,
                                                             name,
                                                             rvOpt,
                                                             maximumOpt,
                                                             arenaOpt);
    return rvCerts;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** nssCryptoContext_FindCertificatesBySubject ( NSSCryptoContext *  cc,
NSSDER subject,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 341 of file cryptocontext.c.

{
    NSSCertificate **rvCerts;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    rvCerts = nssCertificateStore_FindCertificatesBySubject(cc->certStore,
                                                            subject,
                                                            rvOpt,
                                                            maximumOpt,
                                                            arenaOpt);
    return rvCerts;
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindCertificatesBySubject ( NSSCryptoContext *  cc,
NSSDER subject,
NSSCertificate *  rvOpt[],
PRUint32  maximumOpt,
NSSArena *  arenaOpt 
)

Definition at line 363 of file cryptocontext.c.

{
    return nssCryptoContext_FindCertificatesBySubject(cc, subject,
                                                      rvOpt, maximumOpt,
                                                      arenaOpt);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindOrImportCertificate ( NSSCryptoContext *  cc,
NSSCertificate *  c 
)

Definition at line 148 of file cryptocontext.c.

{
    NSSCertificate *rvCert = NULL;

    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       nss_SetError(NSS_ERROR_INVALID_ARGUMENT);
       return rvCert;
    }
    rvCert = nssCertificateStore_FindOrAdd(cc->certStore, c);
    if (rvCert == c && c->object.cryptoContext != cc) {
       PORT_Assert(!c->object.cryptoContext);
       c->object.cryptoContext = cc;
    } 
    if (rvCert) {
       /* an NSSCertificate cannot be part of two crypto contexts
       ** simultaneously.  If this assertion fails, then there is 
       ** a serious Stan design flaw.
       */
       PORT_Assert(cc == c->object.cryptoContext);
    }
    return rvCert;
}

Here is the call graph for this function:

NSS_IMPLEMENT nssSMIMEProfile* nssCryptoContext_FindSMIMEProfileForCertificate ( NSSCryptoContext *  cc,
NSSCertificate *  cert 
)

Definition at line 581 of file cryptocontext.c.

{
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    return nssCertificateStore_FindSMIMEProfileForCertificate(cc->certStore, 
                                                              cert);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSSymmetricKey* NSSCryptoContext_FindSymmetricKeyByAlgorithmAndKeyID ( NSSCryptoContext *  cc,
NSSOID *  algorithm,
NSSItem *  keyID,
NSSCallback *  uhhOpt 
)

Definition at line 636 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSTrust* nssCryptoContext_FindTrustForCertificate ( NSSCryptoContext *  cc,
NSSCertificate *  cert 
)

Definition at line 568 of file cryptocontext.c.

{
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return NULL;
    }
    return nssCertificateStore_FindTrustForCertificate(cc->certStore, cert);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindUserCertificates ( NSSCryptoContext *  cc,
NSSTime *  timeOpt,
NSSUsage *  usageOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 491 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_FindUserCertificatesForEmailSigning ( NSSCryptoContext *  cc,
NSSASCII7 signerOpt,
NSSASCII7 recipientOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 551 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate** NSSCryptoContext_FindUserCertificatesForSSLClientAuth ( NSSCryptoContext *  cc,
NSSUTF8 sslHostOpt,
NSSDER rootCAsOpt[],
PRUint32  rootCAsMaxOpt,
NSSAlgorithmAndParameters *  apOpt,
NSSPolicies *  policiesOpt,
NSSCertificate **  rvOpt,
PRUint32  rvLimit,
NSSArena *  arenaOpt 
)

Definition at line 520 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishDecrypt ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 690 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishDigest ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 1015 of file cryptocontext.c.

{
    return nssToken_FinishDigest(cc->token, cc->session, rvOpt, arenaOpt);
}

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishEncrypt ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 859 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishSign ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 736 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishSignRecover ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 784 of file cryptocontext.c.

Here is the call graph for this function:

Definition at line 905 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_FinishVerifyRecover ( NSSCryptoContext *  cc,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 951 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_GenerateKeyPair ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  ap,
NSSPrivateKey **  pvkOpt,
NSSPublicKey **  pbkOpt,
PRBool  privateKeyIsSensitive,
NSSToken *  destination,
NSSCallback *  uhhOpt 
)

Definition at line 595 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSSymmetricKey* NSSCryptoContext_GenerateSymmetricKey ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  ap,
PRUint32  keysize,
NSSToken *  destination,
NSSCallback *  uhhOpt 
)

Definition at line 610 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSSymmetricKey* NSSCryptoContext_GenerateSymmetricKeyFromPassword ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  ap,
NSSUTF8 passwordOpt,
NSSToken *  destinationOpt,
NSSCallback *  uhhOpt 
)

Definition at line 623 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCallback* NSSCryptoContext_GetDefaultCallback ( NSSCryptoContext *  td,
PRStatus statusOpt 
)

Definition at line 128 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSTrustDomain* NSSCryptoContext_GetTrustDomain ( NSSCryptoContext *  td)

Definition at line 138 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_ImportEncodedCertificate ( NSSCryptoContext *  cc,
NSSBER ber 
)

Definition at line 186 of file cryptocontext.c.

Here is the call graph for this function:

Definition at line 196 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSCertificate* NSSCryptoContext_ImportPKIXCertificate ( NSSCryptoContext *  cc,
struct NSSPKIXCertificateStr *  pc 
)

Definition at line 176 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus nssCryptoContext_ImportSMIMEProfile ( NSSCryptoContext *  cc,
nssSMIMEProfile *  profile 
)

Definition at line 226 of file cryptocontext.c.

{
    PRStatus nssrv;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return PR_FAILURE;
    }
    nssrv = nssCertificateStore_AddSMIMEProfile(cc->certStore, profile);
#if 0
    if (nssrv == PR_SUCCESS) {
       profile->object.cryptoContext = cc;
    }
#endif
    return nssrv;
}

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus nssCryptoContext_ImportTrust ( NSSCryptoContext *  cc,
NSSTrust *  trust 
)

Definition at line 206 of file cryptocontext.c.

{
    PRStatus nssrv;
    PORT_Assert(cc->certStore);
    if (!cc->certStore) {
       return PR_FAILURE;
    }
    nssrv = nssCertificateStore_AddTrust(cc->certStore, trust);
#if 0
    if (nssrv == PR_SUCCESS) {
       trust->object.cryptoContext = cc;
    }
#endif
    return nssrv;
}

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_SetDefaultCallback ( NSSCryptoContext *  td,
NSSCallback *  newCallback,
NSSCallback **  oldCallbackOpt 
)

Definition at line 117 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_Sign ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  data,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 701 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_SignRecover ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  data,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 747 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSSymmetricKey* NSSCryptoContext_UnwrapSymmetricKey ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  wrappedKey,
NSSCallback *  uhhOpt 
)

Definition at line 795 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT PRStatus NSSCryptoContext_Verify ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  data,
NSSItem *  signature,
NSSCallback *  uhhOpt 
)

Definition at line 870 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_VerifyRecover ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSItem *  signature,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 914 of file cryptocontext.c.

Here is the call graph for this function:

NSS_IMPLEMENT NSSItem* NSSCryptoContext_WrapSymmetricKey ( NSSCryptoContext *  cc,
NSSAlgorithmAndParameters *  apOpt,
NSSSymmetricKey *  keyToWrap,
NSSCallback *  uhhOpt,
NSSItem *  rvOpt,
NSSArena *  arenaOpt 
)

Definition at line 962 of file cryptocontext.c.

Here is the call graph for this function:


Variable Documentation

Definition at line 75 of file errorval.c.

Definition at line 80 of file errorval.c.