2 * Copyright (c) 2000-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 // cssmcert - CSSM layer certificate (CL) related objects.
22 #include <Security/cssmcert.h>
23 #include <Security/debugging.h>
30 // Construct an EncodedCertificate
32 EncodedCertificate::EncodedCertificate(CSSM_CERT_TYPE type
, CSSM_CERT_ENCODING enc
,
33 const CSSM_DATA
*data
)
44 // Construct an empty CertGroup.
46 CertGroup::CertGroup(CSSM_CERT_TYPE ctype
,
47 CSSM_CERT_ENCODING encoding
, CSSM_CERTGROUP_TYPE type
)
51 CertEncoding
= encoding
;
57 // Free all memory in a CertGroup
59 void CertGroup::destroy(CssmAllocator
&allocator
)
62 case CSSM_CERTGROUP_DATA
:
63 // array of CSSM_DATA elements
64 for (uint32 n
= 0; n
< count(); n
++)
65 allocator
.free(blobCerts()[n
].data());
67 case CSSM_CERTGROUP_ENCODED_CERT
:
68 for (uint32 n
= 0; n
< count(); n
++)
69 allocator
.free(encodedCerts()[n
].data());
71 case CSSM_CERTGROUP_PARSED_CERT
:
72 // CSSM_PARSED_CERTS array -- unimplemented
73 case CSSM_CERTGROUP_CERT_PAIR
:
74 // CSSM_CERT_PAIR array -- unimplemented
80 } // end namespace Security