security/nss/lib/crmf/cmmfi.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

michael@0 1 /* -*- Mode: C; tab-width: 8 -*-*/
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 * These are the definitions needed by the library internally to implement
michael@0 8 * CMMF. Most of these will be helper utilities for manipulating internal
michael@0 9 * data strucures.
michael@0 10 */
michael@0 11 #ifndef _CMMFI_H_
michael@0 12 #define _CMMFI_H_
michael@0 13 #include "cmmfit.h"
michael@0 14 #include "crmfi.h"
michael@0 15
michael@0 16 #define CMMF_MAX_CHALLENGES 10
michael@0 17 #define CMMF_MAX_KEY_PAIRS 50
michael@0 18
michael@0 19 /*
michael@0 20 * Some templates that the code will need to implement CMMF.
michael@0 21 */
michael@0 22 extern const SEC_ASN1Template CMMFCertOrEncCertCertificateTemplate[];
michael@0 23 extern const SEC_ASN1Template CMMFCertOrEncCertEncryptedCertTemplate[];
michael@0 24 extern const SEC_ASN1Template CMMFPOPODecKeyRespContentTemplate[];
michael@0 25 extern const SEC_ASN1Template CMMFRandTemplate[];
michael@0 26 extern const SEC_ASN1Template CMMFSequenceOfCertsTemplate[];
michael@0 27 extern const SEC_ASN1Template CMMFPKIStatusInfoTemplate[];
michael@0 28 extern const SEC_ASN1Template CMMFCertifiedKeyPairTemplate[];
michael@0 29
michael@0 30
michael@0 31 /*
michael@0 32 * Some utility functions that are shared by multiple files in this
michael@0 33 * implementation.
michael@0 34 */
michael@0 35
michael@0 36 extern SECStatus cmmf_CopyCertResponse (PLArenaPool *poolp,
michael@0 37 CMMFCertResponse *dest,
michael@0 38 CMMFCertResponse *src);
michael@0 39
michael@0 40 extern SECStatus cmmf_CopyPKIStatusInfo (PLArenaPool *poolp,
michael@0 41 CMMFPKIStatusInfo *dest,
michael@0 42 CMMFPKIStatusInfo *src);
michael@0 43
michael@0 44 extern SECStatus cmmf_CopyCertifiedKeyPair(PLArenaPool *poolp,
michael@0 45 CMMFCertifiedKeyPair *dest,
michael@0 46 CMMFCertifiedKeyPair *src);
michael@0 47
michael@0 48 extern SECStatus cmmf_DestroyPKIStatusInfo(CMMFPKIStatusInfo *info,
michael@0 49 PRBool freeit);
michael@0 50
michael@0 51 extern SECStatus cmmf_DestroyCertOrEncCert(CMMFCertOrEncCert *certOrEncCert,
michael@0 52 PRBool freeit);
michael@0 53
michael@0 54 extern SECStatus cmmf_PKIStatusInfoSetStatus(CMMFPKIStatusInfo *statusInfo,
michael@0 55 PLArenaPool *poolp,
michael@0 56 CMMFPKIStatus inStatus);
michael@0 57
michael@0 58 extern SECStatus cmmf_ExtractCertsFromList(CERTCertList *inCertList,
michael@0 59 PLArenaPool *poolp,
michael@0 60 CERTCertificate ***certArray);
michael@0 61
michael@0 62 extern SECStatus
michael@0 63 cmmf_CertOrEncCertSetCertificate(CMMFCertOrEncCert *certOrEncCert,
michael@0 64 PLArenaPool *poolp,
michael@0 65 CERTCertificate *inCert);
michael@0 66
michael@0 67 extern CMMFPKIStatus
michael@0 68 cmmf_PKIStatusInfoGetStatus(CMMFPKIStatusInfo *inStatus);
michael@0 69
michael@0 70 extern CERTCertList*
michael@0 71 cmmf_MakeCertList(CERTCertificate **inCerts);
michael@0 72
michael@0 73 extern CERTCertificate*
michael@0 74 cmmf_CertOrEncCertGetCertificate(CMMFCertOrEncCert *certOrEncCert,
michael@0 75 CERTCertDBHandle *certdb);
michael@0 76
michael@0 77 extern SECStatus
michael@0 78 cmmf_decode_process_cert_response(PLArenaPool *poolp,
michael@0 79 CERTCertDBHandle *db,
michael@0 80 CMMFCertResponse *inCertResp);
michael@0 81
michael@0 82 extern SECStatus
michael@0 83 cmmf_decode_process_certified_key_pair(PLArenaPool *poolp,
michael@0 84 CERTCertDBHandle *db,
michael@0 85 CMMFCertifiedKeyPair *inCertKeyPair);
michael@0 86
michael@0 87 extern SECStatus
michael@0 88 cmmf_user_encode(void *src, CRMFEncoderOutputCallback inCallback, void *inArg,
michael@0 89 const SEC_ASN1Template *inTemplate);
michael@0 90
michael@0 91 extern SECStatus
michael@0 92 cmmf_copy_secitem (PLArenaPool *poolp, SECItem *dest, SECItem *src);
michael@0 93 #endif /*_CMMFI_H_*/
michael@0 94
michael@0 95
michael@0 96
michael@0 97
michael@0 98

mercurial