security/nss/lib/crmf/cmmfi.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/crmf/cmmfi.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,98 @@
     1.4 +/* -*- Mode: C; tab-width: 8 -*-*/
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 + * These are the definitions needed by the library internally to implement
    1.11 + * CMMF.  Most of these will be helper utilities for manipulating internal
    1.12 + * data strucures.
    1.13 + */
    1.14 +#ifndef _CMMFI_H_
    1.15 +#define _CMMFI_H_
    1.16 +#include "cmmfit.h"
    1.17 +#include "crmfi.h"
    1.18 +
    1.19 +#define CMMF_MAX_CHALLENGES 10
    1.20 +#define CMMF_MAX_KEY_PAIRS  50
    1.21 +
    1.22 +/*
    1.23 + * Some templates that the code will need to implement CMMF.
    1.24 + */
    1.25 +extern const SEC_ASN1Template CMMFCertOrEncCertCertificateTemplate[];
    1.26 +extern const SEC_ASN1Template CMMFCertOrEncCertEncryptedCertTemplate[];
    1.27 +extern const SEC_ASN1Template CMMFPOPODecKeyRespContentTemplate[];
    1.28 +extern const SEC_ASN1Template CMMFRandTemplate[];
    1.29 +extern const SEC_ASN1Template CMMFSequenceOfCertsTemplate[];
    1.30 +extern const SEC_ASN1Template CMMFPKIStatusInfoTemplate[];
    1.31 +extern const SEC_ASN1Template CMMFCertifiedKeyPairTemplate[];
    1.32 +
    1.33 +
    1.34 +/*
    1.35 + * Some utility functions that are shared by multiple files in this 
    1.36 + * implementation.
    1.37 + */
    1.38 +
    1.39 +extern SECStatus cmmf_CopyCertResponse (PLArenaPool      *poolp,
    1.40 +					CMMFCertResponse *dest, 
    1.41 +					CMMFCertResponse *src);
    1.42 +
    1.43 +extern SECStatus cmmf_CopyPKIStatusInfo (PLArenaPool       *poolp,
    1.44 +					 CMMFPKIStatusInfo *dest,
    1.45 +					 CMMFPKIStatusInfo *src);
    1.46 +
    1.47 +extern SECStatus cmmf_CopyCertifiedKeyPair(PLArenaPool          *poolp,
    1.48 +					   CMMFCertifiedKeyPair *dest,
    1.49 +					   CMMFCertifiedKeyPair *src);
    1.50 +
    1.51 +extern SECStatus cmmf_DestroyPKIStatusInfo(CMMFPKIStatusInfo *info, 
    1.52 +					   PRBool freeit);
    1.53 +
    1.54 +extern SECStatus cmmf_DestroyCertOrEncCert(CMMFCertOrEncCert *certOrEncCert, 
    1.55 +					   PRBool freeit);
    1.56 +
    1.57 +extern SECStatus cmmf_PKIStatusInfoSetStatus(CMMFPKIStatusInfo    *statusInfo,
    1.58 +					     PLArenaPool          *poolp,
    1.59 +					     CMMFPKIStatus         inStatus);
    1.60 +
    1.61 +extern SECStatus cmmf_ExtractCertsFromList(CERTCertList      *inCertList,
    1.62 +					   PLArenaPool       *poolp,
    1.63 +					   CERTCertificate ***certArray);
    1.64 +
    1.65 +extern SECStatus 
    1.66 +       cmmf_CertOrEncCertSetCertificate(CMMFCertOrEncCert *certOrEncCert,
    1.67 +					PLArenaPool       *poolp,
    1.68 +					CERTCertificate   *inCert);
    1.69 +
    1.70 +extern CMMFPKIStatus 
    1.71 +       cmmf_PKIStatusInfoGetStatus(CMMFPKIStatusInfo *inStatus);
    1.72 +
    1.73 +extern CERTCertList*
    1.74 +       cmmf_MakeCertList(CERTCertificate **inCerts);
    1.75 +
    1.76 +extern CERTCertificate*
    1.77 +cmmf_CertOrEncCertGetCertificate(CMMFCertOrEncCert *certOrEncCert,
    1.78 +                                 CERTCertDBHandle  *certdb);
    1.79 +
    1.80 +extern SECStatus
    1.81 +cmmf_decode_process_cert_response(PLArenaPool      *poolp,
    1.82 +				  CERTCertDBHandle *db,
    1.83 +				  CMMFCertResponse *inCertResp);
    1.84 +
    1.85 +extern SECStatus
    1.86 +cmmf_decode_process_certified_key_pair(PLArenaPool          *poolp,
    1.87 +				       CERTCertDBHandle     *db,
    1.88 +				       CMMFCertifiedKeyPair *inCertKeyPair);
    1.89 +
    1.90 +extern SECStatus
    1.91 +cmmf_user_encode(void *src, CRMFEncoderOutputCallback inCallback, void *inArg,
    1.92 +		 const SEC_ASN1Template *inTemplate);
    1.93 +
    1.94 +extern SECStatus
    1.95 +cmmf_copy_secitem (PLArenaPool *poolp, SECItem *dest, SECItem *src);
    1.96 +#endif /*_CMMFI_H_*/
    1.97 +
    1.98 +
    1.99 +
   1.100 +
   1.101 +

mercurial