]>
git.saurik.com Git - apple/security.git/blob - AppleX509CL/CertBuilder.h
2 * Copyright (c) 2000-2001 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 * CertBuilder.h - sublasses of various snacc-generated cert-related
23 * Created 9/1/2000 by Doug Mitchell.
24 * Copyright (c) 2000 by Apple Computer.
27 #ifndef _CERT_BUILDER_H_
28 #define _CERT_BUILDER_H_
30 #include <Security/asn-incl.h>
31 #include <Security/sm_vdatypes.h>
32 #include <Security/sm_x501if.h>
33 #include <Security/sm_x520sa.h>
34 #include <Security/sm_x411mtsas.h>
35 #include <Security/sm_x509cmn.h>
36 #include <Security/sm_x509af.h>
37 #include <Security/pkcs9oids.h>
38 #include <Security/sm_x509ce.h>
39 #include <Security/sm_cms.h>
40 #include <Security/sm_ess.h>
42 #include <Security/cssmtype.h>
45 * Name is a complex structure which boils down to an arbitrarily
46 * large array of (usually) printable names. We facilitate the
47 * construction of the array, one AttributeTypeAndDistinguishedValue
48 * per RelativeDistinguishedName. This is the format commonly used
49 * in the real world, though it's legal to have multiple ATDVs
50 * per RDN - we just don't do it here.
52 * Typically the object manipulated here is inserted into a
53 * CertificateToSign object, as issuer or subject.
55 class NameBuilder
: public Name
// Name from sm_x501if
59 const AsnOid
&type
, // id_at_commonName, etc.
61 const char *value
, // the bytes
63 DirectoryString::ChoiceIdEnum stringType
, // printableStringCid, etc.
65 bool primaryDistinguished
= true);
68 const CSSM_X509_NAME
*x509Name
);
73 * Custom AsnOid, used for converting CssmOid to AsnOid. The Snacc class
74 * declaration doesn't provide a means to construct from, or set by,
75 * pre-encoded OID bytes (which are available in a CssmOid).
77 class OidBuilder
: public AsnOid
80 OidBuilder(const CSSM_OID
&coid
);
84 #endif /* _CERT_BUILDER_H_ */