mbed TLS v1.3.11
oid.h
Go to the documentation of this file.
1 
24 #ifndef POLARSSL_OID_H
25 #define POLARSSL_OID_H
26 
27 #if !defined(POLARSSL_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include POLARSSL_CONFIG_FILE
31 #endif
32 
33 #include "asn1.h"
34 #include "pk.h"
35 
36 #include <stddef.h>
37 
38 #if defined(POLARSSL_CIPHER_C)
39 #include "cipher.h"
40 #endif
41 
42 #if defined(POLARSSL_MD_C)
43 #include "md.h"
44 #endif
45 
46 #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
47 #include "x509.h"
48 #endif
49 
50 #define POLARSSL_ERR_OID_NOT_FOUND -0x002E
51 #define POLARSSL_ERR_OID_BUF_TOO_SMALL -0x000B
53 /*
54  * Top level OID tuples
55  */
56 #define OID_ISO_MEMBER_BODIES "\x2a" /* {iso(1) member-body(2)} */
57 #define OID_ISO_IDENTIFIED_ORG "\x2b" /* {iso(1) identified-organization(3)} */
58 #define OID_ISO_CCITT_DS "\x55" /* {joint-iso-ccitt(2) ds(5)} */
59 #define OID_ISO_ITU_COUNTRY "\x60" /* {joint-iso-itu-t(2) country(16)} */
60 
61 /*
62  * ISO Member bodies OID parts
63  */
64 #define OID_COUNTRY_US "\x86\x48" /* {us(840)} */
65 #define OID_ORG_RSA_DATA_SECURITY "\x86\xf7\x0d" /* {rsadsi(113549)} */
66 #define OID_RSA_COMPANY OID_ISO_MEMBER_BODIES OID_COUNTRY_US \
67  OID_ORG_RSA_DATA_SECURITY /* {iso(1) member-body(2) us(840) rsadsi(113549)} */
68 #define OID_ORG_ANSI_X9_62 "\xce\x3d" /* ansi-X9-62(10045) */
69 #define OID_ANSI_X9_62 OID_ISO_MEMBER_BODIES OID_COUNTRY_US \
70  OID_ORG_ANSI_X9_62
71 
72 /*
73  * ISO Identified organization OID parts
74  */
75 #define OID_ORG_DOD "\x06" /* {dod(6)} */
76 #define OID_ORG_OIW "\x0e"
77 #define OID_OIW_SECSIG OID_ORG_OIW "\x03"
78 #define OID_OIW_SECSIG_ALG OID_OIW_SECSIG "\x02"
79 #define OID_OIW_SECSIG_SHA1 OID_OIW_SECSIG_ALG "\x1a"
80 #define OID_ORG_CERTICOM "\x81\x04" /* certicom(132) */
81 #define OID_CERTICOM OID_ISO_IDENTIFIED_ORG OID_ORG_CERTICOM
82 #define OID_ORG_TELETRUST "\x24" /* teletrust(36) */
83 #define OID_TELETRUST OID_ISO_IDENTIFIED_ORG OID_ORG_TELETRUST
84 
85 /*
86  * ISO ITU OID parts
87  */
88 #define OID_ORGANIZATION "\x01" /* {organization(1)} */
89 #define OID_ISO_ITU_US_ORG OID_ISO_ITU_COUNTRY OID_COUNTRY_US OID_ORGANIZATION /* {joint-iso-itu-t(2) country(16) us(840) organization(1)} */
90 
91 #define OID_ORG_GOV "\x65" /* {gov(101)} */
92 #define OID_GOV OID_ISO_ITU_US_ORG OID_ORG_GOV /* {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)} */
93 
94 #define OID_ORG_NETSCAPE "\x86\xF8\x42" /* {netscape(113730)} */
95 #define OID_NETSCAPE OID_ISO_ITU_US_ORG OID_ORG_NETSCAPE /* Netscape OID {joint-iso-itu-t(2) country(16) us(840) organization(1) netscape(113730)} */
96 
97 /* ISO arc for standard certificate and CRL extensions */
98 #define OID_ID_CE OID_ISO_CCITT_DS "\x1D"
105 #define OID_PKIX OID_ISO_IDENTIFIED_ORG OID_ORG_DOD "\x01\x05\x05\x07"
106 
107 /*
108  * Arc for standard naming attributes
109  */
110 #define OID_AT OID_ISO_CCITT_DS "\x04"
111 #define OID_AT_CN OID_AT "\x03"
112 #define OID_AT_SUR_NAME OID_AT "\x04"
113 #define OID_AT_SERIAL_NUMBER OID_AT "\x05"
114 #define OID_AT_COUNTRY OID_AT "\x06"
115 #define OID_AT_LOCALITY OID_AT "\x07"
116 #define OID_AT_STATE OID_AT "\x08"
117 #define OID_AT_ORGANIZATION OID_AT "\x0A"
118 #define OID_AT_ORG_UNIT OID_AT "\x0B"
119 #define OID_AT_TITLE OID_AT "\x0C"
120 #define OID_AT_POSTAL_ADDRESS OID_AT "\x10"
121 #define OID_AT_POSTAL_CODE OID_AT "\x11"
122 #define OID_AT_GIVEN_NAME OID_AT "\x2A"
123 #define OID_AT_INITIALS OID_AT "\x2B"
124 #define OID_AT_GENERATION_QUALIFIER OID_AT "\x2C"
125 #define OID_AT_UNIQUE_IDENTIFIER OID_AT "\x2D"
126 #define OID_AT_DN_QUALIFIER OID_AT "\x2E"
127 #define OID_AT_PSEUDONYM OID_AT "\x41"
129 #define OID_DOMAIN_COMPONENT "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19"
131 /*
132  * OIDs for standard certificate extensions
133  */
134 #define OID_AUTHORITY_KEY_IDENTIFIER OID_ID_CE "\x23"
135 #define OID_SUBJECT_KEY_IDENTIFIER OID_ID_CE "\x0E"
136 #define OID_KEY_USAGE OID_ID_CE "\x0F"
137 #define OID_CERTIFICATE_POLICIES OID_ID_CE "\x20"
138 #define OID_POLICY_MAPPINGS OID_ID_CE "\x21"
139 #define OID_SUBJECT_ALT_NAME OID_ID_CE "\x11"
140 #define OID_ISSUER_ALT_NAME OID_ID_CE "\x12"
141 #define OID_SUBJECT_DIRECTORY_ATTRS OID_ID_CE "\x09"
142 #define OID_BASIC_CONSTRAINTS OID_ID_CE "\x13"
143 #define OID_NAME_CONSTRAINTS OID_ID_CE "\x1E"
144 #define OID_POLICY_CONSTRAINTS OID_ID_CE "\x24"
145 #define OID_EXTENDED_KEY_USAGE OID_ID_CE "\x25"
146 #define OID_CRL_DISTRIBUTION_POINTS OID_ID_CE "\x1F"
147 #define OID_INIHIBIT_ANYPOLICY OID_ID_CE "\x36"
148 #define OID_FRESHEST_CRL OID_ID_CE "\x2E"
150 /*
151  * Netscape certificate extensions
152  */
153 #define OID_NS_CERT OID_NETSCAPE "\x01"
154 #define OID_NS_CERT_TYPE OID_NS_CERT "\x01"
155 #define OID_NS_BASE_URL OID_NS_CERT "\x02"
156 #define OID_NS_REVOCATION_URL OID_NS_CERT "\x03"
157 #define OID_NS_CA_REVOCATION_URL OID_NS_CERT "\x04"
158 #define OID_NS_RENEWAL_URL OID_NS_CERT "\x07"
159 #define OID_NS_CA_POLICY_URL OID_NS_CERT "\x08"
160 #define OID_NS_SSL_SERVER_NAME OID_NS_CERT "\x0C"
161 #define OID_NS_COMMENT OID_NS_CERT "\x0D"
162 #define OID_NS_DATA_TYPE OID_NETSCAPE "\x02"
163 #define OID_NS_CERT_SEQUENCE OID_NS_DATA_TYPE "\x05"
164 
165 /*
166  * OIDs for CRL extensions
167  */
168 #define OID_PRIVATE_KEY_USAGE_PERIOD OID_ID_CE "\x10"
169 #define OID_CRL_NUMBER OID_ID_CE "\x14"
171 /*
172  * X.509 v3 Extended key usage OIDs
173  */
174 #define OID_ANY_EXTENDED_KEY_USAGE OID_EXTENDED_KEY_USAGE "\x00"
176 #define OID_KP OID_PKIX "\x03"
177 #define OID_SERVER_AUTH OID_KP "\x01"
178 #define OID_CLIENT_AUTH OID_KP "\x02"
179 #define OID_CODE_SIGNING OID_KP "\x03"
180 #define OID_EMAIL_PROTECTION OID_KP "\x04"
181 #define OID_TIME_STAMPING OID_KP "\x08"
182 #define OID_OCSP_SIGNING OID_KP "\x09"
184 /*
185  * PKCS definition OIDs
186  */
187 
188 #define OID_PKCS OID_RSA_COMPANY "\x01"
189 #define OID_PKCS1 OID_PKCS "\x01"
190 #define OID_PKCS5 OID_PKCS "\x05"
191 #define OID_PKCS9 OID_PKCS "\x09"
192 #define OID_PKCS12 OID_PKCS "\x0c"
194 /*
195  * PKCS#1 OIDs
196  */
197 #define OID_PKCS1_RSA OID_PKCS1 "\x01"
198 #define OID_PKCS1_MD2 OID_PKCS1 "\x02"
199 #define OID_PKCS1_MD4 OID_PKCS1 "\x03"
200 #define OID_PKCS1_MD5 OID_PKCS1 "\x04"
201 #define OID_PKCS1_SHA1 OID_PKCS1 "\x05"
202 #define OID_PKCS1_SHA224 OID_PKCS1 "\x0e"
203 #define OID_PKCS1_SHA256 OID_PKCS1 "\x0b"
204 #define OID_PKCS1_SHA384 OID_PKCS1 "\x0c"
205 #define OID_PKCS1_SHA512 OID_PKCS1 "\x0d"
207 #define OID_RSA_SHA_OBS "\x2B\x0E\x03\x02\x1D"
208 
209 #define OID_PKCS9_EMAIL OID_PKCS9 "\x01"
211 /* RFC 4055 */
212 #define OID_RSASSA_PSS OID_PKCS1 "\x0a"
213 #define OID_MGF1 OID_PKCS1 "\x08"
215 /*
216  * Digest algorithms
217  */
218 #define OID_DIGEST_ALG_MD2 OID_RSA_COMPANY "\x02\x02"
219 #define OID_DIGEST_ALG_MD4 OID_RSA_COMPANY "\x02\x04"
220 #define OID_DIGEST_ALG_MD5 OID_RSA_COMPANY "\x02\x05"
221 #define OID_DIGEST_ALG_SHA1 OID_ISO_IDENTIFIED_ORG OID_OIW_SECSIG_SHA1
222 #define OID_DIGEST_ALG_SHA224 OID_GOV "\x03\x04\x02\x04"
223 #define OID_DIGEST_ALG_SHA256 OID_GOV "\x03\x04\x02\x01"
225 #define OID_DIGEST_ALG_SHA384 OID_GOV "\x03\x04\x02\x02"
227 #define OID_DIGEST_ALG_SHA512 OID_GOV "\x03\x04\x02\x03"
229 #define OID_HMAC_SHA1 OID_RSA_COMPANY "\x02\x07"
231 /*
232  * Encryption algorithms
233  */
234 #define OID_DES_CBC OID_ISO_IDENTIFIED_ORG OID_OIW_SECSIG_ALG "\x07"
235 #define OID_DES_EDE3_CBC OID_RSA_COMPANY "\x03\x07"
237 /*
238  * PKCS#5 OIDs
239  */
240 #define OID_PKCS5_PBKDF2 OID_PKCS5 "\x0c"
241 #define OID_PKCS5_PBES2 OID_PKCS5 "\x0d"
242 #define OID_PKCS5_PBMAC1 OID_PKCS5 "\x0e"
244 /*
245  * PKCS#5 PBES1 algorithms
246  */
247 #define OID_PKCS5_PBE_MD2_DES_CBC OID_PKCS5 "\x01"
248 #define OID_PKCS5_PBE_MD2_RC2_CBC OID_PKCS5 "\x04"
249 #define OID_PKCS5_PBE_MD5_DES_CBC OID_PKCS5 "\x03"
250 #define OID_PKCS5_PBE_MD5_RC2_CBC OID_PKCS5 "\x06"
251 #define OID_PKCS5_PBE_SHA1_DES_CBC OID_PKCS5 "\x0a"
252 #define OID_PKCS5_PBE_SHA1_RC2_CBC OID_PKCS5 "\x0b"
254 /*
255  * PKCS#8 OIDs
256  */
257 #define OID_PKCS9_CSR_EXT_REQ OID_PKCS9 "\x0e"
259 /*
260  * PKCS#12 PBE OIDs
261  */
262 #define OID_PKCS12_PBE OID_PKCS12 "\x01"
264 #define OID_PKCS12_PBE_SHA1_RC4_128 OID_PKCS12_PBE "\x01"
265 #define OID_PKCS12_PBE_SHA1_RC4_40 OID_PKCS12_PBE "\x02"
266 #define OID_PKCS12_PBE_SHA1_DES3_EDE_CBC OID_PKCS12_PBE "\x03"
267 #define OID_PKCS12_PBE_SHA1_DES2_EDE_CBC OID_PKCS12_PBE "\x04"
268 #define OID_PKCS12_PBE_SHA1_RC2_128_CBC OID_PKCS12_PBE "\x05"
269 #define OID_PKCS12_PBE_SHA1_RC2_40_CBC OID_PKCS12_PBE "\x06"
271 /*
272  * EC key algorithms from RFC 5480
273  */
274 
275 /* id-ecPublicKey OBJECT IDENTIFIER ::= {
276  * iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } */
277 #define OID_EC_ALG_UNRESTRICTED OID_ANSI_X9_62 "\x02\01"
278 
279 /* id-ecDH OBJECT IDENTIFIER ::= {
280  * iso(1) identified-organization(3) certicom(132)
281  * schemes(1) ecdh(12) } */
282 #define OID_EC_ALG_ECDH OID_CERTICOM "\x01\x0c"
283 
284 /*
285  * ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2
286  */
287 
288 /* secp192r1 OBJECT IDENTIFIER ::= {
289  * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 1 } */
290 #define OID_EC_GRP_SECP192R1 OID_ANSI_X9_62 "\x03\x01\x01"
291 
292 /* secp224r1 OBJECT IDENTIFIER ::= {
293  * iso(1) identified-organization(3) certicom(132) curve(0) 33 } */
294 #define OID_EC_GRP_SECP224R1 OID_CERTICOM "\x00\x21"
295 
296 /* secp256r1 OBJECT IDENTIFIER ::= {
297  * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 7 } */
298 #define OID_EC_GRP_SECP256R1 OID_ANSI_X9_62 "\x03\x01\x07"
299 
300 /* secp384r1 OBJECT IDENTIFIER ::= {
301  * iso(1) identified-organization(3) certicom(132) curve(0) 34 } */
302 #define OID_EC_GRP_SECP384R1 OID_CERTICOM "\x00\x22"
303 
304 /* secp521r1 OBJECT IDENTIFIER ::= {
305  * iso(1) identified-organization(3) certicom(132) curve(0) 35 } */
306 #define OID_EC_GRP_SECP521R1 OID_CERTICOM "\x00\x23"
307 
308 /* secp192k1 OBJECT IDENTIFIER ::= {
309  * iso(1) identified-organization(3) certicom(132) curve(0) 31 } */
310 #define OID_EC_GRP_SECP192K1 OID_CERTICOM "\x00\x1f"
311 
312 /* secp224k1 OBJECT IDENTIFIER ::= {
313  * iso(1) identified-organization(3) certicom(132) curve(0) 32 } */
314 #define OID_EC_GRP_SECP224K1 OID_CERTICOM "\x00\x20"
315 
316 /* secp256k1 OBJECT IDENTIFIER ::= {
317  * iso(1) identified-organization(3) certicom(132) curve(0) 10 } */
318 #define OID_EC_GRP_SECP256K1 OID_CERTICOM "\x00\x0a"
319 
320 /* RFC 5639 4.1
321  * ecStdCurvesAndGeneration OBJECT IDENTIFIER::= {iso(1)
322  * identified-organization(3) teletrust(36) algorithm(3) signature-
323  * algorithm(3) ecSign(2) 8}
324  * ellipticCurve OBJECT IDENTIFIER ::= {ecStdCurvesAndGeneration 1}
325  * versionOne OBJECT IDENTIFIER ::= {ellipticCurve 1} */
326 #define OID_EC_BRAINPOOL_V1 OID_TELETRUST "\x03\x03\x02\x08\x01\x01"
327 
328 /* brainpoolP256r1 OBJECT IDENTIFIER ::= {versionOne 7} */
329 #define OID_EC_GRP_BP256R1 OID_EC_BRAINPOOL_V1 "\x07"
330 
331 /* brainpoolP384r1 OBJECT IDENTIFIER ::= {versionOne 11} */
332 #define OID_EC_GRP_BP384R1 OID_EC_BRAINPOOL_V1 "\x0B"
333 
334 /* brainpoolP512r1 OBJECT IDENTIFIER ::= {versionOne 13} */
335 #define OID_EC_GRP_BP512R1 OID_EC_BRAINPOOL_V1 "\x0D"
336 
337 /*
338  * SEC1 C.1
339  *
340  * prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 }
341  * id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1)}
342  */
343 #define OID_ANSI_X9_62_FIELD_TYPE OID_ANSI_X9_62 "\x01"
344 #define OID_ANSI_X9_62_PRIME_FIELD OID_ANSI_X9_62_FIELD_TYPE "\x01"
345 
346 /*
347  * ECDSA signature identifiers, from RFC 5480
348  */
349 #define OID_ANSI_X9_62_SIG OID_ANSI_X9_62 "\x04" /* signatures(4) */
350 #define OID_ANSI_X9_62_SIG_SHA2 OID_ANSI_X9_62_SIG "\x03" /* ecdsa-with-SHA2(3) */
351 
352 /* ecdsa-with-SHA1 OBJECT IDENTIFIER ::= {
353  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } */
354 #define OID_ECDSA_SHA1 OID_ANSI_X9_62_SIG "\x01"
355 
356 /* ecdsa-with-SHA224 OBJECT IDENTIFIER ::= {
357  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
358  * ecdsa-with-SHA2(3) 1 } */
359 #define OID_ECDSA_SHA224 OID_ANSI_X9_62_SIG_SHA2 "\x01"
360 
361 /* ecdsa-with-SHA256 OBJECT IDENTIFIER ::= {
362  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
363  * ecdsa-with-SHA2(3) 2 } */
364 #define OID_ECDSA_SHA256 OID_ANSI_X9_62_SIG_SHA2 "\x02"
365 
366 /* ecdsa-with-SHA384 OBJECT IDENTIFIER ::= {
367  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
368  * ecdsa-with-SHA2(3) 3 } */
369 #define OID_ECDSA_SHA384 OID_ANSI_X9_62_SIG_SHA2 "\x03"
370 
371 /* ecdsa-with-SHA512 OBJECT IDENTIFIER ::= {
372  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
373  * ecdsa-with-SHA2(3) 4 } */
374 #define OID_ECDSA_SHA512 OID_ANSI_X9_62_SIG_SHA2 "\x04"
375 
376 #ifdef __cplusplus
377 extern "C" {
378 #endif
379 
383 typedef struct {
384  const char *asn1;
385  size_t asn1_len;
386  const char *name;
387  const char *description;
389 
401 int oid_get_numeric_string( char *buf, size_t size, const asn1_buf *oid );
402 
403 #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
404 
412 int oid_get_x509_ext_type( const asn1_buf *oid, int *ext_type );
413 #endif
414 
424 int oid_get_attr_short_name( const asn1_buf *oid, const char **short_name );
425 
434 int oid_get_pk_alg( const asn1_buf *oid, pk_type_t *pk_alg );
435 
445 int oid_get_oid_by_pk_alg( pk_type_t pk_alg,
446  const char **oid, size_t *olen );
447 
448 #if defined(POLARSSL_ECP_C)
449 
457 int oid_get_ec_grp( const asn1_buf *oid, ecp_group_id *grp_id );
458 
469  const char **oid, size_t *olen );
470 #endif /* POLARSSL_ECP_C */
471 
472 #if defined(POLARSSL_MD_C)
473 
482 int oid_get_sig_alg( const asn1_buf *oid,
483  md_type_t *md_alg, pk_type_t *pk_alg );
484 
493 int oid_get_sig_alg_desc( const asn1_buf *oid, const char **desc );
494 
505 int oid_get_oid_by_sig_alg( pk_type_t pk_alg, md_type_t md_alg,
506  const char **oid, size_t *olen );
507 
516 int oid_get_md_alg( const asn1_buf *oid, md_type_t *md_alg );
517 #endif /* POLARSSL_MD_C */
518 
527 int oid_get_extended_key_usage( const asn1_buf *oid, const char **desc );
528 
538 int oid_get_oid_by_md( md_type_t md_alg, const char **oid, size_t *olen );
539 
540 #if defined(POLARSSL_CIPHER_C)
541 
549 int oid_get_cipher_alg( const asn1_buf *oid, cipher_type_t *cipher_alg );
550 #endif /* POLARSSL_CIPHER_C */
551 
552 #if defined(POLARSSL_PKCS12_C)
553 
563 int oid_get_pkcs12_pbe_alg( const asn1_buf *oid, md_type_t *md_alg,
564  cipher_type_t *cipher_alg );
565 #endif /* POLARSSL_PKCS12_C */
566 
567 #ifdef __cplusplus
568 }
569 #endif
570 
571 #endif /* oid.h */
int oid_get_numeric_string(char *buf, size_t size, const asn1_buf *oid)
Translate an ASN.1 OID into its numeric representation (e.g.
int oid_get_oid_by_ec_grp(ecp_group_id grp_id, const char **oid, size_t *olen)
Translate EC group identifier into NamedCurve OID.
const char * description
Definition: oid.h:387
int oid_get_oid_by_pk_alg(pk_type_t pk_alg, const char **oid, size_t *olen)
Translate pk_type into PublicKeyAlgorithm OID.
int oid_get_pk_alg(const asn1_buf *oid, pk_type_t *pk_alg)
Translate PublicKeyAlgorithm OID into pk_type.
int oid_get_x509_ext_type(const asn1_buf *oid, int *ext_type)
Translate an X.509 extension OID into local values.
Configuration options (set of defines)
int oid_get_md_alg(const asn1_buf *oid, md_type_t *md_alg)
Translate hash algorithm OID into md_type.
Base OID descriptor structure.
Definition: oid.h:383
Public Key abstraction layer.
md_type_t
Definition: md.h:48
Generic ASN.1 parsing.
const char * name
Definition: oid.h:386
cipher_type_t
Definition: cipher.h:83
int oid_get_cipher_alg(const asn1_buf *oid, cipher_type_t *cipher_alg)
Translate encryption algorithm OID into cipher_type.
const char * asn1
Definition: oid.h:384
int oid_get_sig_alg_desc(const asn1_buf *oid, const char **desc)
Translate SignatureAlgorithm OID into description.
Generic cipher wrapper.
pk_type_t
Public key types.
Definition: pk.h:92
int oid_get_pkcs12_pbe_alg(const asn1_buf *oid, md_type_t *md_alg, cipher_type_t *cipher_alg)
Translate PKCS#12 PBE algorithm OID into md_type and cipher_type.
X.509 generic defines and structures.
Generic message digest wrapper.
Type-length-value structure that allows for ASN1 using DER.
Definition: asn1.h:121
int oid_get_ec_grp(const asn1_buf *oid, ecp_group_id *grp_id)
Translate NamedCurve OID into an EC group identifier.
ecp_group_id
Domain parameters (curve, subgroup and generator) identifiers.
Definition: ecp.h:54
int oid_get_oid_by_md(md_type_t md_alg, const char **oid, size_t *olen)
Translate md_type into hash algorithm OID.
size_t asn1_len
Definition: oid.h:385
int oid_get_sig_alg(const asn1_buf *oid, md_type_t *md_alg, pk_type_t *pk_alg)
Translate SignatureAlgorithm OID into md_type and pk_type.
int oid_get_attr_short_name(const asn1_buf *oid, const char **short_name)
Translate an X.509 attribute type OID into the short name (e.g.
int oid_get_extended_key_usage(const asn1_buf *oid, const char **desc)
Translate Extended Key Usage OID into description.
int oid_get_oid_by_sig_alg(pk_type_t pk_alg, md_type_t md_alg, const char **oid, size_t *olen)
Translate md_type and pk_type into SignatureAlgorithm OID.