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 #ifndef _CMMFT_H_
7 #define _CMMFT_H_
8 
9 #include "secasn1.h"
10 
11 /*
12  * These are the enumerations used to distinguish between the different
13  * choices available for the CMMFCertOrEncCert structure.
14  */
15 typedef enum {
16     cmmfNoCertOrEncCert = 0,
17     cmmfCertificate = 1,
18     cmmfEncryptedCert = 2
19 } CMMFCertOrEncCertChoice;
20 
21 /*
22  * This is the enumeration and the corresponding values used to
23  * represent the CMMF type PKIStatus
24  */
25 typedef enum {
26     cmmfNoPKIStatus = -1,
27     cmmfGranted = 0,
28     cmmfGrantedWithMods = 1,
29     cmmfRejection = 2,
30     cmmfWaiting = 3,
31     cmmfRevocationWarning = 4,
32     cmmfRevocationNotification = 5,
33     cmmfKeyUpdateWarning = 6,
34     cmmfNumPKIStatus
35 } CMMFPKIStatus;
36 
37 /*
38  * These enumerations are used to represent the corresponding values
39  * in PKIFailureInfo defined in CMMF.
40  */
41 typedef enum {
42     cmmfBadAlg = 0,
43     cmmfBadMessageCheck = 1,
44     cmmfBadRequest = 2,
45     cmmfBadTime = 3,
46     cmmfBadCertId = 4,
47     cmmfBadDataFormat = 5,
48     cmmfWrongAuthority = 6,
49     cmmfIncorrectData = 7,
50     cmmfMissingTimeStamp = 8,
51     cmmfNoFailureInfo = 9
52 } CMMFPKIFailureInfo;
53 
54 typedef struct CMMFPKIStatusInfoStr CMMFPKIStatusInfo;
55 typedef struct CMMFCertOrEncCertStr CMMFCertOrEncCert;
56 typedef struct CMMFCertifiedKeyPairStr CMMFCertifiedKeyPair;
57 typedef struct CMMFCertResponseStr CMMFCertResponse;
58 typedef struct CMMFCertResponseSeqStr CMMFCertResponseSeq;
59 typedef struct CMMFPOPODecKeyChallContentStr CMMFPOPODecKeyChallContent;
60 typedef struct CMMFChallengeStr CMMFChallenge;
61 typedef struct CMMFRandStr CMMFRand;
62 typedef struct CMMFPOPODecKeyRespContentStr CMMFPOPODecKeyRespContent;
63 typedef struct CMMFKeyRecRepContentStr CMMFKeyRecRepContent;
64 typedef struct CMMFCertRepContentStr CMMFCertRepContent;
65 
66 /* Export this so people can call SEC_ASN1EncodeItem instead of having to
67  * write callbacks that are passed in to the high level encode function
68  * for CMMFCertRepContent.
69  */
70 extern const SEC_ASN1Template CMMFCertRepContentTemplate[];
71 extern const SEC_ASN1Template CMMFPOPODecKeyChallContentTemplate[];
72 
73 #endif /*_CMMFT_H_*/
74