PolarSSL v1.3.7
oid.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_OID_H
28 #define POLARSSL_OID_H
29 
30 #include <string.h>
31 #if !defined(POLARSSL_CONFIG_FILE)
32 #include "config.h"
33 #else
34 #include POLARSSL_CONFIG_FILE
35 #endif
36 #include "asn1.h"
37 #include "pk.h"
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_DN_QUALIFIER OID_AT "\x2E"
126 #define OID_AT_PSEUDONYM OID_AT "\x41"
128 #define OID_DOMAIN_COMPONENT "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19"
130 /*
131  * OIDs for standard certificate extensions
132  */
133 #define OID_AUTHORITY_KEY_IDENTIFIER OID_ID_CE "\x23"
134 #define OID_SUBJECT_KEY_IDENTIFIER OID_ID_CE "\x0E"
135 #define OID_KEY_USAGE OID_ID_CE "\x0F"
136 #define OID_CERTIFICATE_POLICIES OID_ID_CE "\x20"
137 #define OID_POLICY_MAPPINGS OID_ID_CE "\x21"
138 #define OID_SUBJECT_ALT_NAME OID_ID_CE "\x11"
139 #define OID_ISSUER_ALT_NAME OID_ID_CE "\x12"
140 #define OID_SUBJECT_DIRECTORY_ATTRS OID_ID_CE "\x09"
141 #define OID_BASIC_CONSTRAINTS OID_ID_CE "\x13"
142 #define OID_NAME_CONSTRAINTS OID_ID_CE "\x1E"
143 #define OID_POLICY_CONSTRAINTS OID_ID_CE "\x24"
144 #define OID_EXTENDED_KEY_USAGE OID_ID_CE "\x25"
145 #define OID_CRL_DISTRIBUTION_POINTS OID_ID_CE "\x1F"
146 #define OID_INIHIBIT_ANYPOLICY OID_ID_CE "\x36"
147 #define OID_FRESHEST_CRL OID_ID_CE "\x2E"
149 /*
150  * Netscape certificate extensions
151  */
152 #define OID_NS_CERT OID_NETSCAPE "\x01"
153 #define OID_NS_CERT_TYPE OID_NS_CERT "\x01"
154 #define OID_NS_BASE_URL OID_NS_CERT "\x02"
155 #define OID_NS_REVOCATION_URL OID_NS_CERT "\x03"
156 #define OID_NS_CA_REVOCATION_URL OID_NS_CERT "\x04"
157 #define OID_NS_RENEWAL_URL OID_NS_CERT "\x07"
158 #define OID_NS_CA_POLICY_URL OID_NS_CERT "\x08"
159 #define OID_NS_SSL_SERVER_NAME OID_NS_CERT "\x0C"
160 #define OID_NS_COMMENT OID_NS_CERT "\x0D"
161 #define OID_NS_DATA_TYPE OID_NETSCAPE "\x02"
162 #define OID_NS_CERT_SEQUENCE OID_NS_DATA_TYPE "\x05"
163 
164 /*
165  * OIDs for CRL extensions
166  */
167 #define OID_PRIVATE_KEY_USAGE_PERIOD OID_ID_CE "\x10"
168 #define OID_CRL_NUMBER OID_ID_CE "\x14"
170 /*
171  * X.509 v3 Extended key usage OIDs
172  */
173 #define OID_ANY_EXTENDED_KEY_USAGE OID_EXTENDED_KEY_USAGE "\x00"
175 #define OID_KP OID_PKIX "\x03"
176 #define OID_SERVER_AUTH OID_KP "\x01"
177 #define OID_CLIENT_AUTH OID_KP "\x02"
178 #define OID_CODE_SIGNING OID_KP "\x03"
179 #define OID_EMAIL_PROTECTION OID_KP "\x04"
180 #define OID_TIME_STAMPING OID_KP "\x08"
181 #define OID_OCSP_SIGNING OID_KP "\x09"
183 /*
184  * PKCS definition OIDs
185  */
186 
187 #define OID_PKCS OID_RSA_COMPANY "\x01"
188 #define OID_PKCS1 OID_PKCS "\x01"
189 #define OID_PKCS5 OID_PKCS "\x05"
190 #define OID_PKCS9 OID_PKCS "\x09"
191 #define OID_PKCS12 OID_PKCS "\x0c"
193 /*
194  * PKCS#1 OIDs
195  */
196 #define OID_PKCS1_RSA OID_PKCS1 "\x01"
197 #define OID_PKCS1_MD2 OID_PKCS1 "\x02"
198 #define OID_PKCS1_MD4 OID_PKCS1 "\x03"
199 #define OID_PKCS1_MD5 OID_PKCS1 "\x04"
200 #define OID_PKCS1_SHA1 OID_PKCS1 "\x05"
201 #define OID_PKCS1_SHA224 OID_PKCS1 "\x0e"
202 #define OID_PKCS1_SHA256 OID_PKCS1 "\x0b"
203 #define OID_PKCS1_SHA384 OID_PKCS1 "\x0c"
204 #define OID_PKCS1_SHA512 OID_PKCS1 "\x0d"
206 #define OID_RSA_SHA_OBS "\x2B\x0E\x03\x02\x1D"
207 
208 #define OID_PKCS9_EMAIL OID_PKCS9 "\x01"
210 /*
211  * Digest algorithms
212  */
213 #define OID_DIGEST_ALG_MD2 OID_RSA_COMPANY "\x02\x02"
214 #define OID_DIGEST_ALG_MD4 OID_RSA_COMPANY "\x02\x04"
215 #define OID_DIGEST_ALG_MD5 OID_RSA_COMPANY "\x02\x05"
216 #define OID_DIGEST_ALG_SHA1 OID_ISO_IDENTIFIED_ORG OID_OIW_SECSIG_SHA1
217 #define OID_DIGEST_ALG_SHA224 OID_GOV "\x03\x04\x02\x04"
218 #define OID_DIGEST_ALG_SHA256 OID_GOV "\x03\x04\x02\x01"
220 #define OID_DIGEST_ALG_SHA384 OID_GOV "\x03\x04\x02\x02"
222 #define OID_DIGEST_ALG_SHA512 OID_GOV "\x03\x04\x02\x03"
224 #define OID_HMAC_SHA1 OID_RSA_COMPANY "\x02\x07"
226 /*
227  * Encryption algorithms
228  */
229 #define OID_DES_CBC OID_ISO_IDENTIFIED_ORG OID_OIW_SECSIG_ALG "\x07"
230 #define OID_DES_EDE3_CBC OID_RSA_COMPANY "\x03\x07"
232 /*
233  * PKCS#5 OIDs
234  */
235 #define OID_PKCS5_PBKDF2 OID_PKCS5 "\x0c"
236 #define OID_PKCS5_PBES2 OID_PKCS5 "\x0d"
237 #define OID_PKCS5_PBMAC1 OID_PKCS5 "\x0e"
239 /*
240  * PKCS#5 PBES1 algorithms
241  */
242 #define OID_PKCS5_PBE_MD2_DES_CBC OID_PKCS5 "\x01"
243 #define OID_PKCS5_PBE_MD2_RC2_CBC OID_PKCS5 "\x04"
244 #define OID_PKCS5_PBE_MD5_DES_CBC OID_PKCS5 "\x03"
245 #define OID_PKCS5_PBE_MD5_RC2_CBC OID_PKCS5 "\x06"
246 #define OID_PKCS5_PBE_SHA1_DES_CBC OID_PKCS5 "\x0a"
247 #define OID_PKCS5_PBE_SHA1_RC2_CBC OID_PKCS5 "\x0b"
249 /*
250  * PKCS#8 OIDs
251  */
252 #define OID_PKCS9_CSR_EXT_REQ OID_PKCS9 "\x0e"
254 /*
255  * PKCS#12 PBE OIDs
256  */
257 #define OID_PKCS12_PBE OID_PKCS12 "\x01"
259 #define OID_PKCS12_PBE_SHA1_RC4_128 OID_PKCS12_PBE "\x01"
260 #define OID_PKCS12_PBE_SHA1_RC4_40 OID_PKCS12_PBE "\x02"
261 #define OID_PKCS12_PBE_SHA1_DES3_EDE_CBC OID_PKCS12_PBE "\x03"
262 #define OID_PKCS12_PBE_SHA1_DES2_EDE_CBC OID_PKCS12_PBE "\x04"
263 #define OID_PKCS12_PBE_SHA1_RC2_128_CBC OID_PKCS12_PBE "\x05"
264 #define OID_PKCS12_PBE_SHA1_RC2_40_CBC OID_PKCS12_PBE "\x06"
266 /*
267  * EC key algorithms from RFC 5480
268  */
269 
270 /* id-ecPublicKey OBJECT IDENTIFIER ::= {
271  * iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } */
272 #define OID_EC_ALG_UNRESTRICTED OID_ANSI_X9_62 "\x02\01"
273 
274 /* id-ecDH OBJECT IDENTIFIER ::= {
275  * iso(1) identified-organization(3) certicom(132)
276  * schemes(1) ecdh(12) } */
277 #define OID_EC_ALG_ECDH OID_CERTICOM "\x01\x0c"
278 
279 /*
280  * ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2
281  */
282 
283 /* secp192r1 OBJECT IDENTIFIER ::= {
284  * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 1 } */
285 #define OID_EC_GRP_SECP192R1 OID_ANSI_X9_62 "\x03\x01\x01"
286 
287 /* secp224r1 OBJECT IDENTIFIER ::= {
288  * iso(1) identified-organization(3) certicom(132) curve(0) 33 } */
289 #define OID_EC_GRP_SECP224R1 OID_CERTICOM "\x00\x21"
290 
291 /* secp256r1 OBJECT IDENTIFIER ::= {
292  * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 7 } */
293 #define OID_EC_GRP_SECP256R1 OID_ANSI_X9_62 "\x03\x01\x07"
294 
295 /* secp384r1 OBJECT IDENTIFIER ::= {
296  * iso(1) identified-organization(3) certicom(132) curve(0) 34 } */
297 #define OID_EC_GRP_SECP384R1 OID_CERTICOM "\x00\x22"
298 
299 /* secp521r1 OBJECT IDENTIFIER ::= {
300  * iso(1) identified-organization(3) certicom(132) curve(0) 35 } */
301 #define OID_EC_GRP_SECP521R1 OID_CERTICOM "\x00\x23"
302 
303 /* secp192k1 OBJECT IDENTIFIER ::= {
304  * iso(1) identified-organization(3) certicom(132) curve(0) 31 } */
305 #define OID_EC_GRP_SECP192K1 OID_CERTICOM "\x00\x1f"
306 
307 /* secp224k1 OBJECT IDENTIFIER ::= {
308  * iso(1) identified-organization(3) certicom(132) curve(0) 32 } */
309 #define OID_EC_GRP_SECP224K1 OID_CERTICOM "\x00\x20"
310 
311 /* secp256k1 OBJECT IDENTIFIER ::= {
312  * iso(1) identified-organization(3) certicom(132) curve(0) 10 } */
313 #define OID_EC_GRP_SECP256K1 OID_CERTICOM "\x00\x0a"
314 
315 /* RFC 5639 4.1
316  * ecStdCurvesAndGeneration OBJECT IDENTIFIER::= {iso(1)
317  * identified-organization(3) teletrust(36) algorithm(3) signature-
318  * algorithm(3) ecSign(2) 8}
319  * ellipticCurve OBJECT IDENTIFIER ::= {ecStdCurvesAndGeneration 1}
320  * versionOne OBJECT IDENTIFIER ::= {ellipticCurve 1} */
321 #define OID_EC_BRAINPOOL_V1 OID_TELETRUST "\x03\x03\x02\x08\x01\x01"
322 
323 /* brainpoolP256r1 OBJECT IDENTIFIER ::= {versionOne 7} */
324 #define OID_EC_GRP_BP256R1 OID_EC_BRAINPOOL_V1 "\x07"
325 
326 /* brainpoolP384r1 OBJECT IDENTIFIER ::= {versionOne 11} */
327 #define OID_EC_GRP_BP384R1 OID_EC_BRAINPOOL_V1 "\x0B"
328 
329 /* brainpoolP512r1 OBJECT IDENTIFIER ::= {versionOne 13} */
330 #define OID_EC_GRP_BP512R1 OID_EC_BRAINPOOL_V1 "\x0D"
331 
332 /*
333  * SEC1 C.1
334  *
335  * prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 }
336  * id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1)}
337  */
338 #define OID_ANSI_X9_62_FIELD_TYPE OID_ANSI_X9_62 "\x01"
339 #define OID_ANSI_X9_62_PRIME_FIELD OID_ANSI_X9_62_FIELD_TYPE "\x01"
340 
341 /*
342  * ECDSA signature identifiers, from RFC 5480
343  */
344 #define OID_ANSI_X9_62_SIG OID_ANSI_X9_62 "\x04" /* signatures(4) */
345 #define OID_ANSI_X9_62_SIG_SHA2 OID_ANSI_X9_62_SIG "\x03" /* ecdsa-with-SHA2(3) */
346 
347 /* ecdsa-with-SHA1 OBJECT IDENTIFIER ::= {
348  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } */
349 #define OID_ECDSA_SHA1 OID_ANSI_X9_62_SIG "\x01"
350 
351 /* ecdsa-with-SHA224 OBJECT IDENTIFIER ::= {
352  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
353  * ecdsa-with-SHA2(3) 1 } */
354 #define OID_ECDSA_SHA224 OID_ANSI_X9_62_SIG_SHA2 "\x01"
355 
356 /* ecdsa-with-SHA256 OBJECT IDENTIFIER ::= {
357  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
358  * ecdsa-with-SHA2(3) 2 } */
359 #define OID_ECDSA_SHA256 OID_ANSI_X9_62_SIG_SHA2 "\x02"
360 
361 /* ecdsa-with-SHA384 OBJECT IDENTIFIER ::= {
362  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
363  * ecdsa-with-SHA2(3) 3 } */
364 #define OID_ECDSA_SHA384 OID_ANSI_X9_62_SIG_SHA2 "\x03"
365 
366 /* ecdsa-with-SHA512 OBJECT IDENTIFIER ::= {
367  * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
368  * ecdsa-with-SHA2(3) 4 } */
369 #define OID_ECDSA_SHA512 OID_ANSI_X9_62_SIG_SHA2 "\x04"
370 
371 #ifdef __cplusplus
372 extern "C" {
373 #endif
374 
378 typedef struct {
379  const char *asn1;
380  size_t asn1_len;
381  const char *name;
382  const char *description;
384 
396 int oid_get_numeric_string( char *buf, size_t size, const asn1_buf *oid );
397 
398 #if defined(POLARSSL_X509_USE_C) || defined(POLARSSL_X509_CREATE_C)
399 
407 int oid_get_x509_ext_type( const asn1_buf *oid, int *ext_type );
408 #endif
409 
419 int oid_get_attr_short_name( const asn1_buf *oid, const char **short_name );
420 
429 int oid_get_pk_alg( const asn1_buf *oid, pk_type_t *pk_alg );
430 
440 int oid_get_oid_by_pk_alg( pk_type_t pk_alg,
441  const char **oid, size_t *olen );
442 
443 #if defined(POLARSSL_ECP_C)
444 
452 int oid_get_ec_grp( const asn1_buf *oid, ecp_group_id *grp_id );
453 
464  const char **oid, size_t *olen );
465 #endif /* POLARSSL_ECP_C */
466 
467 #if defined(POLARSSL_MD_C)
468 
477 int oid_get_sig_alg( const asn1_buf *oid,
478  md_type_t *md_alg, pk_type_t *pk_alg );
479 
488 int oid_get_sig_alg_desc( const asn1_buf *oid, const char **desc );
489 
500 int oid_get_oid_by_sig_alg( pk_type_t pk_alg, md_type_t md_alg,
501  const char **oid, size_t *olen );
502 
511 int oid_get_md_alg( const asn1_buf *oid, md_type_t *md_alg );
512 #endif /* POLARSSL_MD_C */
513 
522 int oid_get_extended_key_usage( const asn1_buf *oid, const char **desc );
523 
533 int oid_get_oid_by_md( md_type_t md_alg, const char **oid, size_t *olen );
534 
535 #if defined(POLARSSL_CIPHER_C)
536 
544 int oid_get_cipher_alg( const asn1_buf *oid, cipher_type_t *cipher_alg );
545 #endif /* POLARSSL_CIPHER_C */
546 
547 #if defined(POLARSSL_PKCS12_C)
548 
558 int oid_get_pkcs12_pbe_alg( const asn1_buf *oid, md_type_t *md_alg,
559  cipher_type_t *cipher_alg );
560 #endif /* POLARSSL_PKCS12_C */
561 
562 #ifdef __cplusplus
563 }
564 #endif
565 
566 #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:382
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:378
Public Key abstraction layer.
md_type_t
Definition: md.h:51
Generic ASN.1 parsing.
const char * name
Definition: oid.h:381
cipher_type_t
Definition: cipher.h:79
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:379
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:95
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:120
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:57
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:380
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.