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