VirtualBox

source: vbox/trunk/src/VBox/Runtime/common/crypto/x509-template.h@ 53900

Last change on this file since 53900 was 53900, checked in by vboxsync, 10 years ago

IPRT: Implemented X.509 OtherName.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.9 KB
Line 
1/* $Id: x509-template.h 53900 2015-01-21 14:03:50Z vboxsync $ */
2/** @file
3 * IPRT - Crypto - X.509, Code Generator Template.
4 */
5
6/*
7 * Copyright (C) 2006-2014 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#define RTASN1TMPL_DECL RTDECL
28
29/*
30 * X.509 Validity.
31 */
32#define RTASN1TMPL_TYPE RTCRX509VALIDITY
33#define RTASN1TMPL_EXT_NAME RTCrX509Validity
34#define RTASN1TMPL_INT_NAME rtCrX509Validity
35RTASN1TMPL_BEGIN_SEQCORE();
36RTASN1TMPL_MEMBER( NotBefore, RTASN1TIME, RTAsn1Time);
37RTASN1TMPL_MEMBER( NotAfter, RTASN1TIME, RTAsn1Time);
38RTASN1TMPL_EXEC_CHECK_SANITY( rc = rtCrX509Validity_CheckSanityExtra(pThis, fFlags, pErrInfo, pszErrorTag) )
39RTASN1TMPL_END_SEQCORE();
40#undef RTASN1TMPL_TYPE
41#undef RTASN1TMPL_EXT_NAME
42#undef RTASN1TMPL_INT_NAME
43
44
45/*
46 * One X.509 Algorithm Identifier.
47 */
48#define RTASN1TMPL_TYPE RTCRX509ALGORITHMIDENTIFIER
49#define RTASN1TMPL_EXT_NAME RTCrX509AlgorithmIdentifier
50#define RTASN1TMPL_INT_NAME rtCrX509AlgorithmIdentifier
51RTASN1TMPL_BEGIN_SEQCORE();
52RTASN1TMPL_MEMBER( Algorithm, RTASN1OBJID, RTAsn1ObjId);
53RTASN1TMPL_MEMBER_OPT_ANY( Parameters, RTASN1DYNTYPE, RTAsn1DynType);
54RTASN1TMPL_END_SEQCORE();
55#undef RTASN1TMPL_TYPE
56#undef RTASN1TMPL_EXT_NAME
57#undef RTASN1TMPL_INT_NAME
58
59
60/*
61 * Set of X.509 Algorithm Identifiers.
62 */
63#define RTASN1TMPL_TYPE RTCRX509ALGORITHMIDENTIFIERS
64#define RTASN1TMPL_EXT_NAME RTCrX509AlgorithmIdentifiers
65#define RTASN1TMPL_INT_NAME rtCrX509AlgorithmIdentifiers
66RTASN1TMPL_SET_OF(RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
67#undef RTASN1TMPL_TYPE
68#undef RTASN1TMPL_EXT_NAME
69#undef RTASN1TMPL_INT_NAME
70
71
72/*
73 * One X.509 AttributeTypeAndValue.
74 */
75#define RTASN1TMPL_TYPE RTCRX509ATTRIBUTETYPEANDVALUE
76#define RTASN1TMPL_EXT_NAME RTCrX509AttributeTypeAndValue
77#define RTASN1TMPL_INT_NAME rtCrX509AttributeTypeAndValue
78RTASN1TMPL_BEGIN_SEQCORE();
79RTASN1TMPL_MEMBER( Type, RTASN1OBJID, RTAsn1ObjId);
80RTASN1TMPL_MEMBER( Value, RTASN1DYNTYPE, RTAsn1DynType);
81RTASN1TMPL_END_SEQCORE();
82#undef RTASN1TMPL_TYPE
83#undef RTASN1TMPL_EXT_NAME
84#undef RTASN1TMPL_INT_NAME
85
86
87/*
88 * Set of X.509 AttributeTypeAndValues / X.509 RelativeDistinguishedName.
89 */
90#define RTASN1TMPL_TYPE RTCRX509ATTRIBUTETYPEANDVALUES
91#define RTASN1TMPL_EXT_NAME RTCrX509AttributeTypeAndValues
92#define RTASN1TMPL_INT_NAME rtCrX509AttributeTypeAndValues
93RTASN1TMPL_SET_OF(RTCRX509ATTRIBUTETYPEANDVALUE, RTCrX509AttributeTypeAndValue);
94#undef RTASN1TMPL_TYPE
95#undef RTASN1TMPL_EXT_NAME
96#undef RTASN1TMPL_INT_NAME
97
98/*
99 * X.509 Name.
100 */
101#define RTASN1TMPL_TYPE RTCRX509NAME
102#define RTASN1TMPL_EXT_NAME RTCrX509Name
103#define RTASN1TMPL_INT_NAME rtCrX509Name
104#undef RTASN1TMPL_SET_SEQ_EXEC_CHECK_SANITY
105#define RTASN1TMPL_SET_SEQ_EXEC_CHECK_SANITY() rc = rtCrX509Name_CheckSanityExtra(pThis, fFlags, pErrInfo, pszErrorTag)
106RTASN1TMPL_SEQ_OF(RTCRX509RELATIVEDISTINGUISHEDNAME, RTCrX509RelativeDistinguishedName);
107#undef RTASN1TMPL_SET_SEQ_EXEC_CHECK_SANITY
108#define RTASN1TMPL_SET_SEQ_EXEC_CHECK_SANITY() do { } while (0)
109#undef RTASN1TMPL_TYPE
110#undef RTASN1TMPL_EXT_NAME
111#undef RTASN1TMPL_INT_NAME
112
113/*
114 * One X.509 OtherName.
115 * Note! This is simplified and might not work correctly for all types with
116 * non-DER compatible encodings.
117 */
118#define RTASN1TMPL_TYPE RTCRX509OTHERNAME
119#define RTASN1TMPL_EXT_NAME RTCrX509OtherName
120#define RTASN1TMPL_INT_NAME rtCrX509OtherName
121RTASN1TMPL_BEGIN_SEQCORE();
122RTASN1TMPL_MEMBER( TypeId, RTASN1OBJID, RTAsn1ObjId);
123RTASN1TMPL_MEMBER( Value, RTASN1DYNTYPE, RTAsn1DynType);
124RTASN1TMPL_END_SEQCORE();
125#undef RTASN1TMPL_TYPE
126#undef RTASN1TMPL_EXT_NAME
127#undef RTASN1TMPL_INT_NAME
128
129
130/*
131 * One X.509 GeneralName.
132 * Note! This is simplified and might not work correctly for all types with
133 * non-DER compatible encodings.
134 */
135#define RTASN1TMPL_TYPE RTCRX509GENERALNAME
136#define RTASN1TMPL_EXT_NAME RTCrX509GeneralName
137#define RTASN1TMPL_INT_NAME rtCrX509GeneralName
138RTASN1TMPL_BEGIN_PCHOICE();
139RTASN1TMPL_PCHOICE_ITAG( 0, RTCRX509GENERALNAMECHOICE_OTHER_NAME, u.pT0_OtherName, OtherName, RTCRX509OTHERNAME, RTCrX509OtherName);
140RTASN1TMPL_PCHOICE_ITAG_CP( 1, RTCRX509GENERALNAMECHOICE_RFC822_NAME, u.pT1_Rfc822, Rfc822, RTASN1STRING, RTAsn1Ia5String);
141RTASN1TMPL_PCHOICE_ITAG_CP( 2, RTCRX509GENERALNAMECHOICE_DNS_NAME, u.pT2_DnsName, DnsType, RTASN1STRING, RTAsn1Ia5String);
142RTASN1TMPL_PCHOICE_XTAG( 3, RTCRX509GENERALNAMECHOICE_X400_ADDRESS, u.pT3, CtxTag3, X400Address, RTASN1DYNTYPE, RTAsn1DynType); /** @todo */
143RTASN1TMPL_PCHOICE_XTAG( 4, RTCRX509GENERALNAMECHOICE_DIRECTORY_NAME, u.pT4, CtxTag4, DirectoryName, RTCRX509NAME, RTCrX509Name);
144RTASN1TMPL_PCHOICE_XTAG( 5, RTCRX509GENERALNAMECHOICE_EDI_PARTY_NAME, u.pT5, CtxTag5, EdiPartyName, RTASN1DYNTYPE, RTAsn1DynType); /** @todo */
145RTASN1TMPL_PCHOICE_ITAG_CP( 6, RTCRX509GENERALNAMECHOICE_URI, u.pT6_Uri, Uri, RTASN1STRING, RTAsn1Ia5String);
146RTASN1TMPL_PCHOICE_ITAG_CP( 7, RTCRX509GENERALNAMECHOICE_IP_ADDRESS, u.pT7_IpAddress, IpAddress, RTASN1OCTETSTRING, RTAsn1OctetString); /** @todo Constraints */
147RTASN1TMPL_PCHOICE_ITAG_CP( 8, RTCRX509GENERALNAMECHOICE_REGISTERED_ID, u.pT8_RegisteredId,RegisteredId,RTASN1OBJID, RTAsn1ObjId);
148RTASN1TMPL_END_PCHOICE();
149#undef RTASN1TMPL_TYPE
150#undef RTASN1TMPL_EXT_NAME
151#undef RTASN1TMPL_INT_NAME
152
153
154/*
155 * Sequence of X.509 GeneralNames.
156 */
157#define RTASN1TMPL_TYPE RTCRX509GENERALNAMES
158#define RTASN1TMPL_EXT_NAME RTCrX509GeneralNames
159#define RTASN1TMPL_INT_NAME rtCrX509GeneralNames
160RTASN1TMPL_SEQ_OF(RTCRX509GENERALNAME, RTCrX509GeneralName);
161#undef RTASN1TMPL_TYPE
162#undef RTASN1TMPL_EXT_NAME
163#undef RTASN1TMPL_INT_NAME
164
165
166/*
167 * X.509 UniqueIdentifier - RTASN1BITSTRING alias.
168 */
169
170
171/*
172 * X.509 SubjectPublicKeyInfo.
173 */
174#define RTASN1TMPL_TYPE RTCRX509SUBJECTPUBLICKEYINFO
175#define RTASN1TMPL_EXT_NAME RTCrX509SubjectPublicKeyInfo
176#define RTASN1TMPL_INT_NAME rtCrX509SubjectPublicKeyInfo
177RTASN1TMPL_BEGIN_SEQCORE();
178RTASN1TMPL_MEMBER( Algorithm, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
179RTASN1TMPL_MEMBER( SubjectPublicKey, RTASN1BITSTRING, RTAsn1BitString);
180RTASN1TMPL_EXEC_CHECK_SANITY( rc = rtCrX509SubjectPublicKeyInfo_CheckSanityExtra(pThis, fFlags, pErrInfo, pszErrorTag) )
181RTASN1TMPL_END_SEQCORE();
182#undef RTASN1TMPL_TYPE
183#undef RTASN1TMPL_EXT_NAME
184#undef RTASN1TMPL_INT_NAME
185
186
187/*
188 * X.509 AuthorityKeyIdentifier (IPRT representation).
189 */
190#define RTASN1TMPL_TYPE RTCRX509AUTHORITYKEYIDENTIFIER
191#define RTASN1TMPL_EXT_NAME RTCrX509AuthorityKeyIdentifier
192#define RTASN1TMPL_INT_NAME rtCrX509AuthorityKeyIdentifier
193RTASN1TMPL_BEGIN_SEQCORE();
194RTASN1TMPL_MEMBER_OPT_ITAG_CP( KeyIdentifier, RTASN1OCTETSTRING, RTAsn1OctetString, 0);
195RTASN1TMPL_MEMBER_OPT_ITAG( AuthorityCertIssuer, RTCRX509GENERALNAMES, RTCrX509GeneralNames, 1);
196RTASN1TMPL_MEMBER_OPT_ITAG_CP( AuthorityCertSerialNumber, RTASN1INTEGER, RTAsn1Integer, 2);
197RTASN1TMPL_END_SEQCORE();
198#undef RTASN1TMPL_TYPE
199#undef RTASN1TMPL_EXT_NAME
200#undef RTASN1TMPL_INT_NAME
201
202
203/*
204 * X.509 OldAuthorityKeyIdentifier (IPRT representation).
205 */
206#define RTASN1TMPL_TYPE RTCRX509OLDAUTHORITYKEYIDENTIFIER
207#define RTASN1TMPL_EXT_NAME RTCrX509OldAuthorityKeyIdentifier
208#define RTASN1TMPL_INT_NAME rtCrX509OldAuthorityKeyIdentifier
209RTASN1TMPL_BEGIN_SEQCORE();
210RTASN1TMPL_MEMBER_OPT_ITAG_CP( KeyIdentifier, RTASN1OCTETSTRING, RTAsn1OctetString, 0);
211RTASN1TMPL_MEMBER_OPT_XTAG( T1, CtxTag1, AuthorityCertIssuer, RTCRX509NAME, RTCrX509Name, 1);
212RTASN1TMPL_MEMBER_OPT_ITAG_CP( AuthorityCertSerialNumber, RTASN1INTEGER, RTAsn1Integer, 2);
213RTASN1TMPL_END_SEQCORE();
214#undef RTASN1TMPL_TYPE
215#undef RTASN1TMPL_EXT_NAME
216#undef RTASN1TMPL_INT_NAME
217
218
219/*
220 * One X.509 PolicyQualifierInfo.
221 */
222#define RTASN1TMPL_TYPE RTCRX509POLICYQUALIFIERINFO
223#define RTASN1TMPL_EXT_NAME RTCrX509PolicyQualifierInfo
224#define RTASN1TMPL_INT_NAME rtCrX509PolicyQualifierInfo
225RTASN1TMPL_BEGIN_SEQCORE();
226RTASN1TMPL_MEMBER( PolicyQualifierId, RTASN1OBJID, RTAsn1ObjId);
227RTASN1TMPL_MEMBER( Qualifier, RTASN1DYNTYPE, RTAsn1DynType);
228RTASN1TMPL_END_SEQCORE();
229#undef RTASN1TMPL_TYPE
230#undef RTASN1TMPL_EXT_NAME
231#undef RTASN1TMPL_INT_NAME
232
233
234/*
235 * Sequence of X.509 PolicyQualifierInfo.
236 */
237#define RTASN1TMPL_TYPE RTCRX509POLICYQUALIFIERINFOS
238#define RTASN1TMPL_EXT_NAME RTCrX509PolicyQualifierInfos
239#define RTASN1TMPL_INT_NAME rtCrX509PolicyQualifierInfos
240RTASN1TMPL_SEQ_OF(RTCRX509POLICYQUALIFIERINFO, RTCrX509PolicyQualifierInfo);
241#undef RTASN1TMPL_TYPE
242#undef RTASN1TMPL_EXT_NAME
243#undef RTASN1TMPL_INT_NAME
244
245
246/*
247 * One X.509 PolicyInformation.
248 */
249#define RTASN1TMPL_TYPE RTCRX509POLICYINFORMATION
250#define RTASN1TMPL_EXT_NAME RTCrX509PolicyInformation
251#define RTASN1TMPL_INT_NAME rtCrX509PolicyInformation
252RTASN1TMPL_BEGIN_SEQCORE();
253RTASN1TMPL_MEMBER( PolicyIdentifier, RTASN1OBJID, RTAsn1ObjId);
254RTASN1TMPL_MEMBER_OPT_ITAG_UC( PolicyQualifiers, RTCRX509POLICYQUALIFIERINFOS, RTCrX509PolicyQualifierInfos, ASN1_TAG_SEQUENCE);
255RTASN1TMPL_END_SEQCORE();
256#undef RTASN1TMPL_TYPE
257#undef RTASN1TMPL_EXT_NAME
258#undef RTASN1TMPL_INT_NAME
259
260
261/*
262 * Sequence of X.509 CertificatePolicies.
263 */
264#define RTASN1TMPL_TYPE RTCRX509CERTIFICATEPOLICIES
265#define RTASN1TMPL_EXT_NAME RTCrX509CertificatePolicies
266#define RTASN1TMPL_INT_NAME rtCrX509CertificatePolicies
267RTASN1TMPL_SEQ_OF(RTCRX509POLICYINFORMATION, RTCrX509PolicyInformation);
268#undef RTASN1TMPL_TYPE
269#undef RTASN1TMPL_EXT_NAME
270#undef RTASN1TMPL_INT_NAME
271
272
273/*
274 * One X.509 PolicyMapping (IPRT representation).
275 */
276#define RTASN1TMPL_TYPE RTCRX509POLICYMAPPING
277#define RTASN1TMPL_EXT_NAME RTCrX509PolicyMapping
278#define RTASN1TMPL_INT_NAME rtCrX509PolicyMapping
279RTASN1TMPL_BEGIN_SEQCORE();
280RTASN1TMPL_MEMBER( IssuerDomainPolicy, RTASN1OBJID, RTAsn1ObjId);
281RTASN1TMPL_MEMBER( SubjectDomainPolicy, RTASN1OBJID, RTAsn1ObjId);
282RTASN1TMPL_END_SEQCORE();
283#undef RTASN1TMPL_TYPE
284#undef RTASN1TMPL_EXT_NAME
285#undef RTASN1TMPL_INT_NAME
286
287
288/*
289 * Sequence of X.509 PolicyMappings (IPRT representation).
290 */
291#define RTASN1TMPL_TYPE RTCRX509POLICYMAPPINGS
292#define RTASN1TMPL_EXT_NAME RTCrX509PolicyMappings
293#define RTASN1TMPL_INT_NAME rtCrX509PolicyMappings
294RTASN1TMPL_SEQ_OF(RTCRX509POLICYMAPPING, RTCrX509PolicyMapping);
295#undef RTASN1TMPL_TYPE
296#undef RTASN1TMPL_EXT_NAME
297#undef RTASN1TMPL_INT_NAME
298
299
300/*
301 * X.509 BasicConstraints (IPRT representation).
302 */
303#define RTASN1TMPL_TYPE RTCRX509BASICCONSTRAINTS
304#define RTASN1TMPL_EXT_NAME RTCrX509BasicConstraints
305#define RTASN1TMPL_INT_NAME rtCrX509BasicConstraints
306RTASN1TMPL_BEGIN_SEQCORE();
307RTASN1TMPL_MEMBER_DEF_ITAG_UP( CA, RTASN1BOOLEAN, RTAsn1Boolean, ASN1_TAG_BOOLEAN, false);
308RTASN1TMPL_MEMBER_OPT_ITAG_UP( PathLenConstraint, RTASN1INTEGER, RTAsn1Integer, ASN1_TAG_INTEGER);
309RTASN1TMPL_END_SEQCORE();
310#undef RTASN1TMPL_TYPE
311#undef RTASN1TMPL_EXT_NAME
312#undef RTASN1TMPL_INT_NAME
313
314
315/*
316 * X.509 GeneralSubtree (IPRT representation).
317 */
318#define RTASN1TMPL_TYPE RTCRX509GENERALSUBTREE
319#define RTASN1TMPL_EXT_NAME RTCrX509GeneralSubtree
320#define RTASN1TMPL_INT_NAME rtCrX509GeneralSubtree
321RTASN1TMPL_BEGIN_SEQCORE();
322RTASN1TMPL_MEMBER( Base, RTCRX509GENERALNAME, RTCrX509GeneralName);
323RTASN1TMPL_MEMBER_DEF_ITAG_UP( Minimum, RTASN1INTEGER, RTAsn1Integer, ASN1_TAG_INTEGER, 0);
324RTASN1TMPL_MEMBER_OPT_ITAG_UP( Maximum, RTASN1INTEGER, RTAsn1Integer, ASN1_TAG_INTEGER);
325RTASN1TMPL_END_SEQCORE();
326#undef RTASN1TMPL_TYPE
327#undef RTASN1TMPL_EXT_NAME
328#undef RTASN1TMPL_INT_NAME
329
330
331
332/*
333 * Sequence of X.509 GeneralSubtrees (IPRT representation).
334 */
335#define RTASN1TMPL_TYPE RTCRX509GENERALSUBTREES
336#define RTASN1TMPL_EXT_NAME RTCrX509GeneralSubtrees
337#define RTASN1TMPL_INT_NAME rtCrX509GeneralSubtrees
338RTASN1TMPL_SEQ_OF(RTCRX509GENERALSUBTREE, RTCrX509GeneralSubtree);
339#undef RTASN1TMPL_TYPE
340#undef RTASN1TMPL_EXT_NAME
341#undef RTASN1TMPL_INT_NAME
342
343
344/*
345 * X.509 NameConstraints (IPRT representation).
346 */
347#define RTASN1TMPL_TYPE RTCRX509NAMECONSTRAINTS
348#define RTASN1TMPL_EXT_NAME RTCrX509NameConstraints
349#define RTASN1TMPL_INT_NAME rtCrX509NameConstraints
350RTASN1TMPL_BEGIN_SEQCORE();
351RTASN1TMPL_MEMBER_OPT_XTAG( T0, CtxTag0, PermittedSubtrees, RTCRX509GENERALSUBTREES, RTCrX509GeneralSubtrees, 0);
352RTASN1TMPL_MEMBER_OPT_XTAG( T1, CtxTag1, ExcludedSubtrees, RTCRX509GENERALSUBTREES, RTCrX509GeneralSubtrees, 1);
353RTASN1TMPL_END_SEQCORE();
354#undef RTASN1TMPL_TYPE
355#undef RTASN1TMPL_EXT_NAME
356#undef RTASN1TMPL_INT_NAME
357
358
359/*
360 * X.509 PolicyConstraints (IPRT representation).
361 */
362#define RTASN1TMPL_TYPE RTCRX509POLICYCONSTRAINTS
363#define RTASN1TMPL_EXT_NAME RTCrX509PolicyConstraints
364#define RTASN1TMPL_INT_NAME rtCrX509PolicyConstraints
365RTASN1TMPL_BEGIN_SEQCORE();
366RTASN1TMPL_MEMBER_OPT_ITAG_CP( RequireExplicitPolicy, RTASN1INTEGER, RTAsn1Integer, 0);
367RTASN1TMPL_MEMBER_OPT_ITAG_CP( InhibitPolicyMapping, RTASN1INTEGER, RTAsn1Integer, 1);
368RTASN1TMPL_END_SEQCORE();
369#undef RTASN1TMPL_TYPE
370#undef RTASN1TMPL_EXT_NAME
371#undef RTASN1TMPL_INT_NAME
372
373
374/*
375 * One X.509 Extension.
376 */
377#define RTASN1TMPL_TYPE RTCRX509EXTENSION
378#define RTASN1TMPL_EXT_NAME RTCrX509Extension
379#define RTASN1TMPL_INT_NAME rtCrX509Extension
380RTASN1TMPL_BEGIN_SEQCORE();
381RTASN1TMPL_MEMBER( ExtnId, RTASN1OBJID, RTAsn1ObjId);
382RTASN1TMPL_MEMBER_DEF_ITAG_UP( Critical, RTASN1BOOLEAN, RTAsn1Boolean, ASN1_TAG_BOOLEAN, false);
383RTASN1TMPL_MEMBER( ExtnValue, RTASN1OCTETSTRING, RTAsn1OctetString);
384RTASN1TMPL_EXEC_DECODE(rc = RTCrX509Extension_ExtnValue_DecodeAsn1(pCursor, fFlags, pThis, "ExtnValue"))
385RTASN1TMPL_EXEC_CLONE( rc = rtCrX509Extension_ExtnValue_Clone(pThis, pSrc))
386RTASN1TMPL_END_SEQCORE();
387#undef RTASN1TMPL_TYPE
388#undef RTASN1TMPL_EXT_NAME
389#undef RTASN1TMPL_INT_NAME
390
391
392/*
393 * Sequence of X.509 Extensions.
394 */
395#define RTASN1TMPL_TYPE RTCRX509EXTENSIONS
396#define RTASN1TMPL_EXT_NAME RTCrX509Extensions
397#define RTASN1TMPL_INT_NAME rtCrX509Extensions
398RTASN1TMPL_SEQ_OF(RTCRX509EXTENSION, RTCrX509Extension);
399#undef RTASN1TMPL_TYPE
400#undef RTASN1TMPL_EXT_NAME
401#undef RTASN1TMPL_INT_NAME
402
403
404/*
405 * X.509 TbsCertificate.
406 */
407#define RTASN1TMPL_TYPE RTCRX509TBSCERTIFICATE
408#define RTASN1TMPL_EXT_NAME RTCrX509TbsCertificate
409#define RTASN1TMPL_INT_NAME rtCrX509TbsCertificate
410RTASN1TMPL_BEGIN_SEQCORE();
411RTASN1TMPL_MEMBER_OPT_XTAG( T0, CtxTag0, Version, RTASN1INTEGER, RTAsn1Integer, 0);
412RTASN1TMPL_MEMBER( SerialNumber, RTASN1INTEGER, RTAsn1Integer);
413RTASN1TMPL_MEMBER( Signature, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
414RTASN1TMPL_MEMBER( Issuer, RTCRX509NAME, RTCrX509Name);
415RTASN1TMPL_MEMBER( Validity, RTCRX509VALIDITY, RTCrX509Validity);
416RTASN1TMPL_MEMBER( Subject, RTCRX509NAME, RTCrX509Name);
417RTASN1TMPL_MEMBER( SubjectPublicKeyInfo, RTCRX509SUBJECTPUBLICKEYINFO, RTCrX509SubjectPublicKeyInfo);
418RTASN1TMPL_MEMBER_OPT_XTAG( T1, CtxTag1, IssuerUniqueId, RTCRX509UNIQUEIDENTIFIER, RTCrX509UniqueIdentifier, 1);
419RTASN1TMPL_MEMBER_OPT_XTAG( T2, CtxTag2, SubjectUniqueId, RTCRX509UNIQUEIDENTIFIER, RTCrX509UniqueIdentifier, 2);
420RTASN1TMPL_MEMBER_OPT_XTAG( T3, CtxTag3, Extensions, RTCRX509EXTENSIONS, RTCrX509Extensions, 3);
421RTASN1TMPL_EXEC_DECODE( rc = RTCrX509TbsCertificate_ReprocessExtensions(pThis, pCursor->pPrimary->pErrInfo) )
422RTASN1TMPL_EXEC_CLONE( rc = RTCrX509TbsCertificate_ReprocessExtensions(pThis, NULL) )
423RTASN1TMPL_EXEC_CHECK_SANITY( rc = rtCrX509TbsCertificate_CheckSanityExtra(pThis, fFlags, pErrInfo, pszErrorTag) )
424RTASN1TMPL_END_SEQCORE();
425#undef RTASN1TMPL_TYPE
426#undef RTASN1TMPL_EXT_NAME
427#undef RTASN1TMPL_INT_NAME
428
429
430/*
431 * One X.509 Certificate.
432 */
433#define RTASN1TMPL_TYPE RTCRX509CERTIFICATE
434#define RTASN1TMPL_EXT_NAME RTCrX509Certificate
435#define RTASN1TMPL_INT_NAME rtCrX509Certificate
436RTASN1TMPL_BEGIN_SEQCORE();
437RTASN1TMPL_MEMBER( TbsCertificate, RTCRX509TBSCERTIFICATE, RTCrX509TbsCertificate);
438RTASN1TMPL_MEMBER( SignatureAlgorithm, RTCRX509ALGORITHMIDENTIFIER, RTCrX509AlgorithmIdentifier);
439RTASN1TMPL_MEMBER( SignatureValue, RTASN1BITSTRING, RTAsn1BitString);
440RTASN1TMPL_EXEC_CHECK_SANITY( rc = rtCrX509Certificate_CheckSanityExtra(pThis, fFlags, pErrInfo, pszErrorTag) )
441RTASN1TMPL_END_SEQCORE();
442#undef RTASN1TMPL_TYPE
443#undef RTASN1TMPL_EXT_NAME
444#undef RTASN1TMPL_INT_NAME
445
446
447/*
448 * Set of X.509 Certificates.
449 */
450/** @todo Microsoft Hacks. ExtendedCertificates. */
451#define RTASN1TMPL_TYPE RTCRX509CERTIFICATES
452#define RTASN1TMPL_EXT_NAME RTCrX509Certificates
453#define RTASN1TMPL_INT_NAME rtCrX509Certificates
454RTASN1TMPL_SET_OF(RTCRX509CERTIFICATE, RTCrX509Certificate);
455#undef RTASN1TMPL_TYPE
456#undef RTASN1TMPL_EXT_NAME
457#undef RTASN1TMPL_INT_NAME
458
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette