2 * Copyright (c) 2004,2011,2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
23 * SecNetscapeTemplates.cpp - Structs and templates for DER encoding and
24 * decoding of Netscape-style certificate requests
25 * and certificate sequences.
28 #include "SecNetscapeTemplates.h"
29 #include <Security/SecAsn1Templates.h>
30 #include <Security/secasn1t.h>
33 const SecAsn1Template NetscapeCertSequenceTemplate
[] = {
35 0, NULL
, sizeof(NetscapeCertSequence
) },
37 offsetof(NetscapeCertSequence
, contentType
), 0},
38 { SEC_ASN1_EXPLICIT
| SEC_ASN1_CONSTRUCTED
|
39 SEC_ASN1_CONTEXT_SPECIFIC
| 0 ,
40 offsetof(NetscapeCertSequence
, certs
),
41 kSecAsn1SequenceOfAnyTemplate
},
44 const SecAsn1Template PublicKeyAndChallengeTemplate
[] = {
46 0, NULL
, sizeof(PublicKeyAndChallenge
) },
48 offsetof(PublicKeyAndChallenge
, spki
),
49 kSecAsn1SubjectPublicKeyInfoTemplate
},
51 offsetof(PublicKeyAndChallenge
, challenge
),
52 kSecAsn1IA5StringTemplate
},
56 extern const SecAsn1Template SignedPublicKeyAndChallengeTemplate
[] = {
58 0, NULL
, sizeof(SignedPublicKeyAndChallenge
) },
60 offsetof(SignedPublicKeyAndChallenge
, pubKeyAndChallenge
),
61 PublicKeyAndChallengeTemplate
},
63 offsetof(SignedPublicKeyAndChallenge
, algId
),
64 kSecAsn1AlgorithmIDTemplate
},
65 { SEC_ASN1_BIT_STRING
,
66 offsetof(SignedPublicKeyAndChallenge
, signature
) },