1 /* -*- Mode: C; tab-width: 8 -*-*/
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is the Netscape security libraries.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1994-2000
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 /* Header file with all of the structures and types that will be exported
40 * by the security library for implementation of CRMF.
46 /* Use these enumerated values for adding fields to the certificate request */
58 } CRMFCertTemplateField
;
61 * An enumeration for the different types of controls.
65 crmfRegTokenControl
= 1,
66 crmfAuthenticatorControl
= 2,
67 crmfPKIPublicationInfoControl
= 3,
68 crmfPKIArchiveOptionsControl
= 4,
69 crmfOldCertIDControl
= 5,
70 crmfProtocolEncrKeyControl
= 6
74 * The possible values that are passed into CRMF_CreatePKIPublicationInfo
79 } CRMFPublicationAction
;
82 * An enumeration for the possible for pubMethod which is a part of
83 * the SinglePubInfo ASN1 type.
90 } CRMFPublicationMethod
;
93 * An enumeration for the different options for PKIArchiveOptions type.
96 crmfNoArchiveOptions
= 0,
97 crmfEncryptedPrivateKey
= 1,
98 crmfKeyGenParameters
= 2,
99 crmfArchiveRemGenPrivKey
= 3
100 } CRMFPKIArchiveOptionsType
;
103 * An enumeration for the different options for ProofOfPossession
109 crmfKeyEncipherment
= 3,
114 * An enumertion type for options for the authInfo field of the
115 * CRMFPOPOSigningKeyInput structure.
120 } CRMFPOPOSkiInputAuthChoice
;
123 * An enumeration for the SubsequentMessage Options.
126 crmfNoSubseqMess
= 0,
128 crmfChallengeResp
= 2
129 } CRMFSubseqMessOptions
;
132 * An enumeration for the choice used by POPOPrivKey.
137 crmfSubsequentMessage
= 2,
139 } CRMFPOPOPrivKeyChoice
;
142 * An enumeration for the choices for the EncryptedKey type.
145 crmfNoEncryptedKeyChoice
= 0,
146 crmfEncryptedValueChoice
= 1,
147 crmfEnvelopedDataChoice
= 2
148 } CRMFEncryptedKeyChoice
;
151 * TYPE: CRMFEncoderOutputCallback
152 * This function type defines a prototype for a function that the CRMF
153 * library expects when encoding is performed.
157 * This will be a pointer the user passed into an encoding function.
158 * The user of the library is free to use this pointer in any way.
159 * The most common use is to keep around a buffer for writing out
160 * the DER encoded bytes.
162 * The DER encoded bytes that should be written out.
164 * The number of DER encoded bytes to write out.
167 typedef void (*CRMFEncoderOutputCallback
) (void *arg
,
172 * Type for the function that gets a password. Just in case we ever
173 * need to support publicKeyMAC for POPOSigningKeyInput
175 typedef SECItem
* (*CRMFMACPasswordCallback
) (void *arg
);
177 typedef struct CRMFOptionalValidityStr CRMFOptionalValidity
;
178 typedef struct CRMFValidityCreationInfoStr CRMFGetValidity
;
179 typedef struct CRMFCertTemplateStr CRMFCertTemplate
;
180 typedef struct CRMFCertRequestStr CRMFCertRequest
;
181 typedef struct CRMFCertReqMsgStr CRMFCertReqMsg
;
182 typedef struct CRMFCertReqMessagesStr CRMFCertReqMessages
;
183 typedef struct CRMFProofOfPossessionStr CRMFProofOfPossession
;
184 typedef struct CRMFPOPOSigningKeyStr CRMFPOPOSigningKey
;
185 typedef struct CRMFPOPOSigningKeyInputStr CRMFPOPOSigningKeyInput
;
186 typedef struct CRMFPOPOPrivKeyStr CRMFPOPOPrivKey
;
187 typedef struct CRMFPKIPublicationInfoStr CRMFPKIPublicationInfo
;
188 typedef struct CRMFSinglePubInfoStr CRMFSinglePubInfo
;
189 typedef struct CRMFPKIArchiveOptionsStr CRMFPKIArchiveOptions
;
190 typedef struct CRMFEncryptedKeyStr CRMFEncryptedKey
;
191 typedef struct CRMFEncryptedValueStr CRMFEncryptedValue
;
192 typedef struct CRMFCertIDStr CRMFCertID
;
193 typedef struct CRMFCertIDStr CRMFOldCertID
;
194 typedef CERTSubjectPublicKeyInfo CRMFProtocolEncrKey
;
195 typedef struct CRMFValidityCreationInfoStr CRMFValidityCreationInfo
;
196 typedef struct CRMFCertExtCreationInfoStr CRMFCertExtCreationInfo
;
197 typedef struct CRMFPKMACValueStr CRMFPKMACValue
;
198 typedef struct CRMFAttributeStr CRMFAttribute
;
199 typedef struct CRMFControlStr CRMFControl
;
200 typedef CERTGeneralName CRMFGeneralName
;
201 typedef struct CRMFCertExtensionStr CRMFCertExtension
;
203 struct CRMFValidityCreationInfoStr
{
208 struct CRMFCertExtCreationInfoStr
{
209 CRMFCertExtension
**extensions
;
214 * Some ASN1 Templates that may be needed.
216 extern const SEC_ASN1Template CRMFCertReqMessagesTemplate
[];
217 extern const SEC_ASN1Template CRMFCertRequestTemplate
[];