]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_apple_x509_cl/lib/DecodedCrl.h
2 * Copyright (c) 2002,2011,2014 Apple 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).
24 * See DecodedItem.h for details on the care and feeding of this
28 #ifndef _DECODED_CRL_H_
29 #define _DECODED_CRL_H_
31 #include <Security/cssmtype.h>
32 #include <security_cdsa_utilities/cssmdata.h>
34 #include "DecodedItem.h"
35 #include <Security/X509Templates.h>
37 class DecodedCrl
: /* for now public CertificateList, */ public DecodedItem
41 /* construct empty CRL, no decoded extensions */
43 AppleX509CLSession
&session
);
45 /* one-shot constructor, decoding from DER-encoded data */
47 AppleX509CLSession
&session
,
48 const CssmData
&encodedCrl
);
52 /* decode CRLToSign and its extensions */
54 const CssmData
&encodedCTS
);
56 /* encode TBSCert and its extensions */
57 void encodeExtensions();
59 CssmOwnedData
&encodedTbs
);
62 *** field accessors (in CrlFields.cpp)
66 * Obtain the index'th occurrence of field specified by fieldId.
67 * Format of the returned field depends on fieldId.
68 * Returns total number of fieldId fields in the cert if index is 0.
69 * Returns true if specified field was found, else returns false.
72 const CssmOid
&fieldId
, // which field
73 unsigned index
, // which occurrence (0 = first)
74 uint32
&numFields
, // RETURNED
75 CssmOwnedData
&fieldValue
); // RETURNED
78 * Set the field specified by fieldId in TBS.
79 * Note no index - individual field routines either append (for extensions)
80 * or throw if field already set (for all others)
83 const CssmOid
&fieldId
, // which field
84 const CssmData
&fieldValue
);
87 * Free the fieldId-specific data referred to by fieldValue.get().data().
89 static void freeCrlFieldData(
90 const CssmOid
&fieldId
,
91 CssmOwnedData
&fieldValue
);
93 void getAllParsedCrlFields(
94 uint32
&NumberOfFields
, // RETURNED
95 CSSM_FIELD_PTR
&CertFields
); // RETURNED
97 static void describeFormat(
99 uint32
&NumberOfFields
,
100 CSSM_OID_PTR
&OidList
);
106 #endif /* _DECODED_CRL_H_ */