]>
git.saurik.com Git - apple/security.git/blob - AppleX509CL/DecodedCrl.h
2 * Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 * DecodedCrl.h - object representing a decoded cert in NSS form, with
21 * extensions parsed and decoded (still in NSS format).
23 * Created 8/28/2002 by Doug Mitchell.
25 * See DecodedItem.h for details on the care and feeding of this
29 #ifndef _DECODED_CRL_H_
30 #define _DECODED_CRL_H_
32 #include <Security/cssmtype.h>
33 #include <Security/cssmdata.h>
35 #include "DecodedItem.h"
36 #include <SecurityNssAsn1/X509Templates.h>
38 class DecodedCrl
: /* for now public CertificateList, */ public DecodedItem
42 /* construct empty CRL, no decoded extensions */
44 AppleX509CLSession
&session
);
46 /* one-shot constructor, decoding from DER-encoded data */
48 AppleX509CLSession
&session
,
49 const CssmData
&encodedCrl
);
53 /* decode CRLToSign and its extensions */
55 const CssmData
&encodedCTS
);
57 /* encode TBSCert and its extensions */
58 void encodeExtensions();
60 CssmOwnedData
&encodedTbs
);
63 *** field accessors (in CrlFields.cpp)
67 * Obtain the index'th occurrence of field specified by fieldId.
68 * Format of the returned field depends on fieldId.
69 * Returns total number of fieldId fields in the cert if index is 0.
70 * Returns true if specified field was found, else returns false.
73 const CssmOid
&fieldId
, // which field
74 unsigned index
, // which occurrence (0 = first)
75 uint32
&numFields
, // RETURNED
76 CssmOwnedData
&fieldValue
); // RETURNED
79 * Set the field specified by fieldId in TBS.
80 * Note no index - individual field routines either append (for extensions)
81 * or throw if field already set (for all others)
84 const CssmOid
&fieldId
, // which field
85 const CssmData
&fieldValue
);
88 * Free the fieldId-specific data referred to by fieldValue.get().data().
90 static void freeCrlFieldData(
91 const CssmOid
&fieldId
,
92 CssmOwnedData
&fieldValue
);
94 void getAllParsedCrlFields(
95 uint32
&NumberOfFields
, // RETURNED
96 CSSM_FIELD_PTR
&CertFields
); // RETURNED
98 static void describeFormat(
100 uint32
&NumberOfFields
,
101 CSSM_OID_PTR
&OidList
);
107 #endif /* _DECODED_CRL_H_ */