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 ***** */
42 struct CRMFCertReqMessagesStr
{
43 CRMFCertReqMsg
**messages
;
47 struct CRMFCertExtensionStr
{
54 struct CRMFOptionalValidityStr
{
59 struct CRMFCertTemplateStr
{
62 SECAlgorithmID
*signingAlg
;
64 CRMFOptionalValidity
*validity
;
66 CERTSubjectPublicKeyInfo
*publicKey
;
69 CRMFCertExtension
**extensions
;
73 struct CRMFCertIDStr
{
74 SECItem issuer
; /* General Name */
75 SECItem serialNumber
; /*INTEGER*/
78 struct CRMFEncryptedValueStr
{
79 SECAlgorithmID
*intendedAlg
;
80 SECAlgorithmID
*symmAlg
;
81 SECItem encSymmKey
; /*BIT STRING */
82 SECAlgorithmID
*keyAlg
;
83 SECItem valueHint
; /*OCTET STRING */
84 SECItem encValue
; /*BIT STRING */
88 * The field derValue will contain the actual der
89 * to include in the encoding or that was read in
92 struct CRMFEncryptedKeyStr
{
94 SEC_PKCS7ContentInfo
*envelopedData
;
95 CRMFEncryptedValue encryptedValue
;
97 CRMFEncryptedKeyChoice encKeyChoice
;
101 /* ASN1 must only have one of the following 3 options. */
102 struct CRMFPKIArchiveOptionsStr
{
104 CRMFEncryptedKey encryptedKey
;
105 SECItem keyGenParameters
;
106 SECItem archiveRemGenPrivKey
; /* BOOLEAN */
108 CRMFPKIArchiveOptionsType archOption
;
111 struct CRMFPKIPublicationInfoStr
{
112 SECItem action
; /* Possible values */
113 /* dontPublish (0), pleasePublish (1) */
114 CRMFSinglePubInfo
**pubInfos
;
117 struct CRMFControlStr
{
121 /* These will be C structures used to represent the various
122 * options. Values that can't be stored as der right away.
123 * After creating these structures, we'll place their der
124 * encoding in derValue so the encoder knows how to get to
128 CRMFCertID oldCertId
;
129 CRMFPKIArchiveOptions archiveOptions
;
130 CRMFPKIPublicationInfo pubInfo
;
131 CRMFProtocolEncrKey protEncrKey
;
135 struct CRMFCertRequestStr
{
137 CRMFCertTemplate certTemplate
;
138 CRMFControl
**controls
;
139 /* The following members are used by the internal implementation, but
140 * are not part of the encoding.
143 PRUint32 requestID
; /* This is the value that will be encoded into
144 * the certReqId field.
148 struct CRMFAttributeStr
{
153 struct CRMFCertReqMsgStr
{
154 CRMFCertRequest
*certReq
;
155 CRMFProofOfPossession
*pop
;
156 CRMFAttribute
**regInfo
;
158 /* This arena will be used for allocating memory when decoding.
164 struct CRMFPOPOSigningKeyInputStr
{
165 /* ASN1 must have only one of the next 2 options */
167 SECItem sender
; /*General Name*/
168 CRMFPKMACValue
*publicKeyMAC
;
170 CERTSubjectPublicKeyInfo publicKey
;
173 struct CRMFPOPOSigningKeyStr
{
174 SECItem derInput
; /*If in the future we support
175 *POPOSigningKeyInput, this will
176 *a C structure representation
179 SECAlgorithmID
*algorithmIdentifier
;
180 SECItem signature
; /* This is a BIT STRING. Remember */
181 }; /* that when interpreting. */
183 /* ASN1 must only choose one of these members */
184 struct CRMFPOPOPrivKeyStr
{
186 SECItem thisMessage
; /* BIT STRING */
187 SECItem subsequentMessage
; /*INTEGER*/
188 SECItem dhMAC
; /*BIT STRING*/
190 CRMFPOPOPrivKeyChoice messageChoice
;
193 /* ASN1 must only have one of these options. */
194 struct CRMFProofOfPossessionStr
{
197 CRMFPOPOSigningKey signature
;
198 CRMFPOPOPrivKey keyEncipherment
;
199 CRMFPOPOPrivKey keyAgreement
;
201 CRMFPOPChoice popUsed
; /*Not part of encoding*/
204 struct CRMFPKMACValueStr
{
205 SECAlgorithmID algID
;
206 SECItem value
; /*BIT STRING*/
209 struct CRMFSinglePubInfoStr
{
210 SECItem pubMethod
; /* Possible Values:
216 CERTGeneralName
*pubLocation
; /* General Name */
219 #endif /* _CRMFIT_H_ */