1 1.2 christos /* $NetBSD: certificate.h,v 1.2 2021/08/14 16:14:51 christos Exp $ */ 2 1.2 christos 3 1.1 lukem 4 1.1 lukem #include "asn-incl.h" 5 1.1 lukem /* 6 1.1 lukem * certificate.h 7 1.1 lukem * "AuthenticationFramework" ASN.1 module encode/decode/extracting/matching/free C src. 8 1.1 lukem * This file was generated by modified eSMACC compiler Sat Dec 11 11:22:49 2004 9 1.1 lukem * The generated files are strongly encouraged to be 10 1.1 lukem * compiled as a module for OpenLDAP Software 11 1.1 lukem */ 12 1.1 lukem 13 1.1 lukem #ifndef _certificate_h_ 14 1.1 lukem #define _certificate_h_ 15 1.1 lukem 16 1.1 lukem 17 1.1 lukem 18 1.1 lukem 19 1.1 lukem #ifdef __cplusplus 20 1.1 lukem extern "C" { 21 1.1 lukem #endif 22 1.1 lukem #ifdef _WIN32 23 1.1 lukem #pragma warning( disable : 4101 ) 24 1.1 lukem #endif 25 1.1 lukem #include "componentlib.h" 26 1.1 lukem typedef enum AuthenticationFrameworkAnyId 27 1.1 lukem { 28 1.1 lukem nullOid_ANY_ID = 0, 29 1.1 lukem nullOid2_ANY_ID = 1, 30 1.1 lukem nullOid3_ANY_ID = 2, 31 1.1 lukem printableStringOid_ANY_ID = 3, 32 1.1 lukem printableStringOid2_ANY_ID = 4, 33 1.1 lukem printableStringOid3_ANY_ID = 5, 34 1.1 lukem printableStringOid4_ANY_ID = 6, 35 1.1 lukem printableStringOid5_ANY_ID = 7, 36 1.1 lukem printableStringOid6_ANY_ID = 8, 37 1.1 lukem printableStringOid7_ANY_ID = 9, 38 1.1 lukem iA5StringOid_ANY_ID = 10, 39 1.1 lukem octetStringOid_ANY_ID = 11, 40 1.1 lukem octetStringOid2_ANY_ID = 12, 41 1.1 lukem octetStringOid3_ANY_ID = 13, 42 1.1 lukem octetStringOid4_ANY_ID = 14, 43 1.1 lukem octetStringOid5_ANY_ID = 15, 44 1.1 lukem octetStringOid7_ANY_ID = 17} AuthenticationFrameworkAnyId; 45 1.1 lukem 46 1.1 lukem void InitAnyAuthenticationFramework(); 47 1.1 lukem 48 1.1 lukem 49 1.1 lukem #define V1 0 50 1.1 lukem #define V2 1 51 1.1 lukem #define V3 2 52 1.1 lukem 53 1.1 lukem typedef ComponentInt ComponentVersion; /* INTEGER { V1 (0), V2 (1), V3 (2) } */ 54 1.1 lukem 55 1.1 lukem #define MatchingComponentVersion MatchingComponentInt 56 1.1 lukem 57 1.1 lukem #define ExtractingComponentVersion ExtractingComponentInt 58 1.1 lukem 59 1.1 lukem #define BDecComponentVersion BDecComponentInt 60 1.1 lukem 61 1.1 lukem #define GDecComponentVersion GDecComponentInt 62 1.1 lukem 63 1.1 lukem 64 1.1 lukem typedef ComponentInt ComponentCertificateSerialNumber; /* INTEGER */ 65 1.1 lukem 66 1.1 lukem #define MatchingComponentCertificateSerialNumber MatchingComponentInt 67 1.1 lukem 68 1.1 lukem #define ExtractingComponentCertificateSerialNumber ExtractingComponentInt 69 1.1 lukem 70 1.1 lukem #define BDecComponentCertificateSerialNumber BDecComponentInt 71 1.1 lukem 72 1.1 lukem #define GDecComponentCertificateSerialNumber GDecComponentInt 73 1.1 lukem 74 1.1 lukem 75 1.1 lukem typedef ComponentOid ComponentAttributeType; /* OBJECT IDENTIFIER */ 76 1.1 lukem 77 1.1 lukem #define MatchingComponentAttributeType MatchingComponentOid 78 1.1 lukem 79 1.1 lukem #define ExtractingComponentAttributeType ExtractingComponentOid 80 1.1 lukem 81 1.1 lukem #define BDecComponentAttributeType BDecComponentOid 82 1.1 lukem 83 1.1 lukem #define GDecComponentAttributeType GDecComponentOid 84 1.1 lukem 85 1.1 lukem 86 1.1 lukem typedef ComponentBits ComponentUniqueIdentifier; /* BIT STRING */ 87 1.1 lukem 88 1.1 lukem #define MatchingComponentUniqueIdentifier MatchingComponentBits 89 1.1 lukem 90 1.1 lukem #define ExtractingComponentUniqueIdentifier ExtractingComponentBits 91 1.1 lukem 92 1.1 lukem #define BDecComponentUniqueIdentifier BDecComponentBits 93 1.1 lukem 94 1.1 lukem #define GDecComponentUniqueIdentifier GDecComponentBits 95 1.1 lukem 96 1.1 lukem 97 1.1 lukem typedef struct AlgorithmIdentifier /* SEQUENCE */ 98 1.1 lukem { 99 1.1 lukem Syntax* syntax; 100 1.1 lukem ComponentDesc* comp_desc; 101 1.1 lukem struct berval identifier; 102 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 103 1.1 lukem ComponentOid algorithm; /* OBJECT IDENTIFIER */ 104 1.1 lukem ComponentAnyDefinedBy parameters; /* ANY DEFINED BY algorithm OPTIONAL */ 105 1.1 lukem } ComponentAlgorithmIdentifier; 106 1.1 lukem 107 1.1 lukem int MatchingComponentAlgorithmIdentifier PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 108 1.1 lukem 109 1.1 lukem 110 1.1 lukem void* ExtractingComponentAlgorithmIdentifier PROTO (( void* mem_op, ComponentReference *cr, ComponentAlgorithmIdentifier *comp )); 111 1.1 lukem 112 1.1 lukem 113 1.1 lukem int BDecComponentAlgorithmIdentifier PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentAlgorithmIdentifier **v, AsnLen *bytesDecoded, int mode)); 114 1.1 lukem 115 1.1 lukem 116 1.1 lukem int GDecComponentAlgorithmIdentifier PROTO (( void* mem_op, GenBuf * b, ComponentAlgorithmIdentifier **v, AsnLen *bytesDecoded, int mode)); 117 1.1 lukem 118 1.1 lukem 119 1.1 lukem 120 1.1 lukem typedef struct Time /* CHOICE */ 121 1.1 lukem { 122 1.1 lukem Syntax* syntax; 123 1.1 lukem ComponentDesc* comp_desc; 124 1.1 lukem struct berval identifier; 125 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 126 1.1 lukem enum TimeChoiceId 127 1.1 lukem { 128 1.1 lukem TIME_UTCTIME, 129 1.1 lukem TIME_GENERALIZEDTIME 130 1.1 lukem } choiceId; 131 1.1 lukem union TimeChoiceUnion 132 1.1 lukem { 133 1.1 lukem ComponentUTCTime* utcTime; /* < unknown type id ?! > */ 134 1.1 lukem ComponentGeneralizedTime* generalizedTime; /* < unknown type id ?! > */ 135 1.1 lukem } a; 136 1.1 lukem } ComponentTime; 137 1.1 lukem 138 1.1 lukem int MatchingComponentTime PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 139 1.1 lukem 140 1.1 lukem 141 1.1 lukem void* ExtractingComponentTime PROTO (( void* mem_op, ComponentReference *cr, ComponentTime *comp )); 142 1.1 lukem 143 1.1 lukem 144 1.1 lukem int BDecComponentTime PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTime **v, AsnLen *bytesDecoded, int mode)); 145 1.1 lukem 146 1.1 lukem 147 1.1 lukem int GDecComponentTime PROTO (( void* mem_op, GenBuf * b, ComponentTime **v, AsnLen *bytesDecoded, int mode)); 148 1.1 lukem 149 1.1 lukem 150 1.1 lukem 151 1.1 lukem typedef struct Extension /* SEQUENCE */ 152 1.1 lukem { 153 1.1 lukem Syntax* syntax; 154 1.1 lukem ComponentDesc* comp_desc; 155 1.1 lukem struct berval identifier; 156 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 157 1.1 lukem ComponentOid extnID; /* OBJECT IDENTIFIER */ 158 1.1 lukem ComponentBool* critical; /* BOOLEAN DEFAULT FALSE */ 159 1.1 lukem ComponentOcts extnValue; /* OCTET STRING */ 160 1.1 lukem } ComponentExtension; 161 1.1 lukem 162 1.1 lukem int MatchingComponentExtension PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 163 1.1 lukem 164 1.1 lukem 165 1.1 lukem void* ExtractingComponentExtension PROTO (( void* mem_op, ComponentReference *cr, ComponentExtension *comp )); 166 1.1 lukem 167 1.1 lukem 168 1.1 lukem int BDecComponentExtension PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentExtension **v, AsnLen *bytesDecoded, int mode)); 169 1.1 lukem 170 1.1 lukem 171 1.1 lukem int GDecComponentExtension PROTO (( void* mem_op, GenBuf * b, ComponentExtension **v, AsnLen *bytesDecoded, int mode)); 172 1.1 lukem 173 1.1 lukem 174 1.1 lukem 175 1.1 lukem typedef struct AttributeTypeAndValue /* SEQUENCE */ 176 1.1 lukem { 177 1.1 lukem Syntax* syntax; 178 1.1 lukem ComponentDesc* comp_desc; 179 1.1 lukem struct berval identifier; 180 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 181 1.1 lukem ComponentAttributeType type; /* AttributeType */ 182 1.1 lukem ComponentAnyDefinedBy value; /* ANY DEFINED BY type */ 183 1.1 lukem } ComponentAttributeTypeAndValue; 184 1.1 lukem 185 1.1 lukem int MatchingComponentAttributeTypeAndValue PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 186 1.1 lukem 187 1.1 lukem 188 1.1 lukem void* ExtractingComponentAttributeTypeAndValue PROTO (( void* mem_op, ComponentReference *cr, ComponentAttributeTypeAndValue *comp )); 189 1.1 lukem 190 1.1 lukem 191 1.1 lukem int BDecComponentAttributeTypeAndValue PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentAttributeTypeAndValue **v, AsnLen *bytesDecoded, int mode)); 192 1.1 lukem 193 1.1 lukem 194 1.1 lukem int GDecComponentAttributeTypeAndValue PROTO (( void* mem_op, GenBuf * b, ComponentAttributeTypeAndValue **v, AsnLen *bytesDecoded, int mode)); 195 1.1 lukem 196 1.1 lukem 197 1.1 lukem 198 1.1 lukem typedef struct Validity /* SEQUENCE */ 199 1.1 lukem { 200 1.1 lukem Syntax* syntax; 201 1.1 lukem ComponentDesc* comp_desc; 202 1.1 lukem struct berval identifier; 203 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 204 1.1 lukem ComponentTime* notBefore; /* Time */ 205 1.1 lukem ComponentTime* notAfter; /* Time */ 206 1.1 lukem } ComponentValidity; 207 1.1 lukem 208 1.1 lukem int MatchingComponentValidity PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 209 1.1 lukem 210 1.1 lukem 211 1.1 lukem void* ExtractingComponentValidity PROTO (( void* mem_op, ComponentReference *cr, ComponentValidity *comp )); 212 1.1 lukem 213 1.1 lukem 214 1.1 lukem int BDecComponentValidity PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentValidity **v, AsnLen *bytesDecoded, int mode)); 215 1.1 lukem 216 1.1 lukem 217 1.1 lukem int GDecComponentValidity PROTO (( void* mem_op, GenBuf * b, ComponentValidity **v, AsnLen *bytesDecoded, int mode)); 218 1.1 lukem 219 1.1 lukem 220 1.1 lukem 221 1.1 lukem typedef struct SubjectPublicKeyInfo /* SEQUENCE */ 222 1.1 lukem { 223 1.1 lukem Syntax* syntax; 224 1.1 lukem ComponentDesc* comp_desc; 225 1.1 lukem struct berval identifier; 226 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 227 1.1 lukem ComponentAlgorithmIdentifier* algorithm; /* AlgorithmIdentifier */ 228 1.1 lukem ComponentBits subjectPublicKey; /* BIT STRING */ 229 1.1 lukem } ComponentSubjectPublicKeyInfo; 230 1.1 lukem 231 1.1 lukem int MatchingComponentSubjectPublicKeyInfo PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 232 1.1 lukem 233 1.1 lukem 234 1.1 lukem void* ExtractingComponentSubjectPublicKeyInfo PROTO (( void* mem_op, ComponentReference *cr, ComponentSubjectPublicKeyInfo *comp )); 235 1.1 lukem 236 1.1 lukem 237 1.1 lukem int BDecComponentSubjectPublicKeyInfo PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentSubjectPublicKeyInfo **v, AsnLen *bytesDecoded, int mode)); 238 1.1 lukem 239 1.1 lukem 240 1.1 lukem int GDecComponentSubjectPublicKeyInfo PROTO (( void* mem_op, GenBuf * b, ComponentSubjectPublicKeyInfo **v, AsnLen *bytesDecoded, int mode)); 241 1.1 lukem 242 1.1 lukem 243 1.1 lukem 244 1.1 lukem typedef ComponentList ComponentExtensions; /* SEQUENCE SIZE 1..MAX OF Extension */ 245 1.1 lukem 246 1.1 lukem int MatchingComponentExtensions PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 247 1.1 lukem 248 1.1 lukem 249 1.1 lukem void* ExtractingComponentExtensions PROTO (( void* mem_op, ComponentReference *cr, ComponentExtensions *comp )); 250 1.1 lukem 251 1.1 lukem 252 1.1 lukem int BDecComponentExtensions PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentExtensions **v, AsnLen *bytesDecoded, int mode)); 253 1.1 lukem 254 1.1 lukem 255 1.1 lukem int GDecComponentExtensions PROTO (( void* mem_op, GenBuf * b, ComponentExtensions **v, AsnLen *bytesDecoded, int mode)); 256 1.1 lukem 257 1.1 lukem 258 1.1 lukem 259 1.1 lukem typedef ComponentList ComponentRelativeDistinguishedName; /* SET OF AttributeTypeAndValue */ 260 1.1 lukem 261 1.1 lukem int MatchingComponentRelativeDistinguishedName PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 262 1.1 lukem 263 1.1 lukem 264 1.1 lukem void* ExtractingComponentRelativeDistinguishedName PROTO (( void* mem_op, ComponentReference *cr, ComponentRelativeDistinguishedName *comp )); 265 1.1 lukem 266 1.1 lukem 267 1.1 lukem int BDecComponentRelativeDistinguishedName PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentRelativeDistinguishedName **v, AsnLen *bytesDecoded, int mode)); 268 1.1 lukem 269 1.1 lukem 270 1.1 lukem int GDecComponentRelativeDistinguishedName PROTO (( void* mem_op, GenBuf * b, ComponentRelativeDistinguishedName **v, AsnLen *bytesDecoded, int mode)); 271 1.1 lukem 272 1.1 lukem 273 1.1 lukem 274 1.1 lukem typedef ComponentList ComponentRDNSequence; /* SEQUENCE OF RelativeDistinguishedName */ 275 1.1 lukem 276 1.1 lukem int MatchingComponentRDNSequence PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 277 1.1 lukem 278 1.1 lukem 279 1.1 lukem void* ExtractingComponentRDNSequence PROTO (( void* mem_op, ComponentReference *cr, ComponentRDNSequence *comp )); 280 1.1 lukem 281 1.1 lukem 282 1.1 lukem int BDecComponentRDNSequence PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentRDNSequence **v, AsnLen *bytesDecoded, int mode)); 283 1.1 lukem 284 1.1 lukem 285 1.1 lukem int GDecComponentRDNSequence PROTO (( void* mem_op, GenBuf * b, ComponentRDNSequence **v, AsnLen *bytesDecoded, int mode)); 286 1.1 lukem 287 1.1 lukem 288 1.1 lukem 289 1.1 lukem typedef struct Name /* CHOICE */ 290 1.1 lukem { 291 1.1 lukem Syntax* syntax; 292 1.1 lukem ComponentDesc* comp_desc; 293 1.1 lukem struct berval identifier; 294 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 295 1.1 lukem enum NameChoiceId 296 1.1 lukem { 297 1.1 lukem NAME_RDNSEQUENCE 298 1.1 lukem } choiceId; 299 1.1 lukem union NameChoiceUnion 300 1.1 lukem { 301 1.1 lukem ComponentRDNSequence* rdnSequence; /* RDNSequence */ 302 1.1 lukem } a; 303 1.1 lukem } ComponentName; 304 1.1 lukem 305 1.1 lukem int MatchingComponentName PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 306 1.1 lukem 307 1.1 lukem 308 1.1 lukem void* ExtractingComponentName PROTO (( void* mem_op, ComponentReference *cr, ComponentName *comp )); 309 1.1 lukem 310 1.1 lukem 311 1.1 lukem int BDecComponentName PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentName **v, AsnLen *bytesDecoded, int mode)); 312 1.1 lukem 313 1.1 lukem 314 1.1 lukem int GDecComponentName PROTO (( void* mem_op, GenBuf * b, ComponentName **v, AsnLen *bytesDecoded, int mode)); 315 1.1 lukem 316 1.1 lukem 317 1.1 lukem 318 1.1 lukem typedef struct TBSCertificate /* SEQUENCE */ 319 1.1 lukem { 320 1.1 lukem Syntax* syntax; 321 1.1 lukem ComponentDesc* comp_desc; 322 1.1 lukem struct berval identifier; 323 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 324 1.1 lukem ComponentVersion* version; /* [0] Version DEFAULT v1 */ 325 1.1 lukem ComponentCertificateSerialNumber serialNumber; /* CertificateSerialNumber */ 326 1.1 lukem ComponentAlgorithmIdentifier* signature; /* AlgorithmIdentifier */ 327 1.1 lukem ComponentName* issuer; /* Name */ 328 1.1 lukem ComponentValidity* validity; /* Validity */ 329 1.1 lukem ComponentName* subject; /* Name */ 330 1.1 lukem ComponentSubjectPublicKeyInfo* subjectPublicKeyInfo; /* SubjectPublicKeyInfo */ 331 1.1 lukem ComponentUniqueIdentifier issuerUniqueIdentifier; /* [1] IMPLICIT UniqueIdentifier OPTIONAL */ 332 1.1 lukem ComponentUniqueIdentifier subjectUniqueIdentifier; /* [2] IMPLICIT UniqueIdentifier OPTIONAL */ 333 1.1 lukem ComponentExtensions* extensions; /* [3] Extensions OPTIONAL */ 334 1.1 lukem } ComponentTBSCertificate; 335 1.1 lukem 336 1.1 lukem int MatchingComponentTBSCertificate PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 337 1.1 lukem 338 1.1 lukem 339 1.1 lukem void* ExtractingComponentTBSCertificate PROTO (( void* mem_op, ComponentReference *cr, ComponentTBSCertificate *comp )); 340 1.1 lukem 341 1.1 lukem 342 1.1 lukem int BDecComponentTBSCertificate PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentTBSCertificate **v, AsnLen *bytesDecoded, int mode)); 343 1.1 lukem 344 1.1 lukem 345 1.1 lukem int GDecComponentTBSCertificate PROTO (( void* mem_op, GenBuf * b, ComponentTBSCertificate **v, AsnLen *bytesDecoded, int mode)); 346 1.1 lukem 347 1.1 lukem 348 1.1 lukem 349 1.1 lukem typedef struct Certificate /* SEQUENCE */ 350 1.1 lukem { 351 1.1 lukem Syntax* syntax; 352 1.1 lukem ComponentDesc* comp_desc; 353 1.1 lukem struct berval identifier; 354 1.1 lukem char id_buf[MAX_IDENTIFIER_LEN]; 355 1.1 lukem ComponentTBSCertificate* toBeSigned; /* TBSCertificate */ 356 1.1 lukem ComponentAlgorithmIdentifier* signatureAlgorithm; /* AlgorithmIdentifier */ 357 1.1 lukem ComponentBits signature; /* BIT STRING */ 358 1.1 lukem } ComponentCertificate; 359 1.1 lukem 360 1.1 lukem int MatchingComponentCertificate PROTO (( char *oid, ComponentSyntaxInfo *, ComponentSyntaxInfo *v2 )); 361 1.1 lukem 362 1.1 lukem 363 1.1 lukem void* ExtractingComponentCertificate PROTO (( void* mem_op, ComponentReference *cr, ComponentCertificate *comp )); 364 1.1 lukem 365 1.1 lukem 366 1.1 lukem int BDecComponentCertificate PROTO ((void* mem_op, GenBuf * b, AsnTag tagId0, AsnLen elmtLen0, ComponentCertificate **v, AsnLen *bytesDecoded, int mode)); 367 1.1 lukem 368 1.1 lukem 369 1.1 lukem int GDecComponentCertificate PROTO (( void* mem_op, GenBuf * b, ComponentCertificate **v, AsnLen *bytesDecoded, int mode)); 370 1.1 lukem 371 1.1 lukem 372 1.1 lukem 373 1.1 lukem /* ========== Object Declarations ========== */ 374 1.1 lukem 375 1.1 lukem 376 1.1 lukem /* ========== Object Set Declarations ========== */ 377 1.1 lukem #ifdef __cplusplus 378 1.1 lukem extern "C" { 379 1.1 lukem #endif 380 1.1 lukem 381 1.1 lukem #endif /* conditional include of certificate.h */ 382