security/nss/lib/pki/pki.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef PKI_H
     6 #define PKI_H
     8 #ifndef NSSDEVT_H
     9 #include "nssdevt.h"
    10 #endif /* NSSDEVT_H */
    12 #ifndef NSSPKI_H
    13 #include "nsspki.h"
    14 #endif /* NSSPKI_H */
    16 #ifndef PKIT_H
    17 #include "pkit.h"
    18 #endif /* PKIT_H */
    20 PR_BEGIN_EXTERN_C
    22 NSS_EXTERN NSSCallback *
    23 nssTrustDomain_GetDefaultCallback
    24 (
    25   NSSTrustDomain *td,
    26   PRStatus *statusOpt
    27 );
    29 NSS_EXTERN NSSCertificate **
    30 nssTrustDomain_FindCertificatesBySubject
    31 (
    32   NSSTrustDomain *td,
    33   NSSDER *subject,
    34   NSSCertificate *rvOpt[],
    35   PRUint32 maximumOpt,
    36   NSSArena *arenaOpt
    37 );
    39 NSS_EXTERN NSSTrust *
    40 nssTrustDomain_FindTrustForCertificate
    41 (
    42   NSSTrustDomain *td,
    43   NSSCertificate *c
    44 );
    46 NSS_EXTERN NSSCertificate *
    47 nssCertificate_AddRef
    48 (
    49   NSSCertificate *c
    50 );
    52 NSS_EXTERN PRStatus
    53 nssCertificate_Destroy
    54 (
    55   NSSCertificate *c
    56 );
    58 NSS_EXTERN NSSDER *
    59 nssCertificate_GetEncoding
    60 (
    61   NSSCertificate *c
    62 );
    64 NSS_EXTERN NSSDER *
    65 nssCertificate_GetIssuer
    66 (
    67   NSSCertificate *c
    68 );
    70 NSS_EXTERN NSSDER *
    71 nssCertificate_GetSerialNumber
    72 (
    73   NSSCertificate *c
    74 );
    76 NSS_EXTERN NSSDER *
    77 nssCertificate_GetSubject
    78 (
    79   NSSCertificate *c
    80 );
    82 /* Returns a copy, Caller must free using nss_ZFreeIf */
    83 NSS_EXTERN NSSUTF8 *
    84 nssCertificate_GetNickname
    85 (
    86   NSSCertificate *c,
    87   NSSToken *tokenOpt
    88 );
    90 NSS_EXTERN NSSASCII7 *
    91 nssCertificate_GetEmailAddress
    92 (
    93   NSSCertificate *c
    94 );
    96 NSS_EXTERN PRBool
    97 nssCertificate_IssuerAndSerialEqual
    98 (
    99   NSSCertificate *c1,
   100   NSSCertificate *c2
   101 );
   103 NSS_EXTERN NSSPrivateKey *
   104 nssPrivateKey_AddRef
   105 (
   106   NSSPrivateKey *vk
   107 );
   109 NSS_EXTERN PRStatus
   110 nssPrivateKey_Destroy
   111 (
   112   NSSPrivateKey *vk
   113 );
   115 NSS_EXTERN NSSItem *
   116 nssPrivateKey_GetID
   117 (
   118   NSSPrivateKey *vk
   119 );
   121 NSS_EXTERN NSSUTF8 *
   122 nssPrivateKey_GetNickname
   123 (
   124   NSSPrivateKey *vk,
   125   NSSToken *tokenOpt
   126 );
   128 NSS_EXTERN PRStatus
   129 nssPublicKey_Destroy
   130 (
   131   NSSPublicKey *bk
   132 );
   134 NSS_EXTERN NSSItem *
   135 nssPublicKey_GetID
   136 (
   137   NSSPublicKey *vk
   138 );
   140 NSS_EXTERN NSSCertificate **
   141 nssCryptoContext_FindCertificatesBySubject
   142 (
   143   NSSCryptoContext *cc,
   144   NSSDER *subject,
   145   NSSCertificate *rvOpt[],
   146   PRUint32 maximumOpt, /* 0 for no max */
   147   NSSArena *arenaOpt
   148 );
   150 /* putting here for now, needs more thought */
   151 NSS_EXTERN PRStatus
   152 nssCryptoContext_ImportTrust
   153 (
   154   NSSCryptoContext *cc,
   155   NSSTrust *trust
   156 );
   158 NSS_EXTERN NSSTrust *
   159 nssCryptoContext_FindTrustForCertificate
   160 (
   161   NSSCryptoContext *cc,
   162   NSSCertificate *cert
   163 );
   165 NSS_EXTERN PRStatus
   166 nssCryptoContext_ImportSMIMEProfile
   167 (
   168   NSSCryptoContext *cc,
   169   nssSMIMEProfile *profile
   170 );
   172 NSS_EXTERN nssSMIMEProfile *
   173 nssCryptoContext_FindSMIMEProfileForCertificate
   174 (
   175   NSSCryptoContext *cc,
   176   NSSCertificate *cert
   177 );
   179 NSS_EXTERN NSSTrust *
   180 nssTrust_AddRef
   181 (
   182   NSSTrust *trust
   183 );
   185 NSS_EXTERN PRStatus
   186 nssTrust_Destroy
   187 (
   188   NSSTrust *trust
   189 );
   191 NSS_EXTERN nssSMIMEProfile *
   192 nssSMIMEProfile_AddRef
   193 (
   194   nssSMIMEProfile *profile
   195 );
   197 NSS_EXTERN PRStatus
   198 nssSMIMEProfile_Destroy
   199 (
   200   nssSMIMEProfile *profile
   201 );
   203 NSS_EXTERN nssSMIMEProfile *
   204 nssSMIMEProfile_Create
   205 (
   206   NSSCertificate *cert,
   207   NSSItem *profileTime,
   208   NSSItem *profileData
   209 );
   211 PR_END_EXTERN_C
   213 #endif /* PKI_H */

mercurial