Example program to test AES-GCM functionality. Used for a workshop

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

oid.h File Reference

oid.h File Reference

Object Identifier (OID) database. More...

Go to the source code of this file.

Data Structures

struct  oid_descriptor_t
 Base OID descriptor structure. More...

Functions

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_x509_ext_type (const asn1_buf *oid, int *ext_type)
 Translate an X.509 extension OID into local values.
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_pk_alg (const asn1_buf *oid, pk_type_t *pk_alg)
 Translate PublicKeyAlgorithm OID into pk_type.
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_ec_grp (const asn1_buf *oid, ecp_group_id *grp_id)
 Translate NamedCurve OID into an EC group identifier.
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.
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_sig_alg_desc (const asn1_buf *oid, const char **desc)
 Translate SignatureAlgorithm 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.
int oid_get_md_alg (const asn1_buf *oid, md_type_t *md_alg)
 Translate hash algorithm OID into md_type.
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_md (md_type_t md_alg, const char **oid, size_t *olen)
 Translate md_type into hash algorithm OID.
int oid_get_cipher_alg (const asn1_buf *oid, cipher_type_t *cipher_alg)
 Translate encryption algorithm OID into cipher_type.
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.

Detailed Description

Object Identifier (OID) database.

Copyright (C) 2006-2014, Brainspark B.V.

This file is part of PolarSSL (http://www.polarssl.org) Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>

All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file oid.h.


Function Documentation

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.

the OID for an X520 Common Name into "CN")

Parameters:
oidOID to use
short_nameplace to store the string pointer
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_cipher_alg ( const asn1_buf oid,
cipher_type_t *  cipher_alg 
)

Translate encryption algorithm OID into cipher_type.

Parameters:
oidOID to use
cipher_algplace to store cipher algorithm
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_ec_grp ( const asn1_buf oid,
ecp_group_id grp_id 
)

Translate NamedCurve OID into an EC group identifier.

Parameters:
oidOID to use
grp_idplace to store group id
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_extended_key_usage ( const asn1_buf oid,
const char **  desc 
)

Translate Extended Key Usage OID into description.

Parameters:
oidOID to use
descplace to store string pointer
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_md_alg ( const asn1_buf oid,
md_type_t *  md_alg 
)

Translate hash algorithm OID into md_type.

Parameters:
oidOID to use
md_algplace to store message digest algorithm
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
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.

"\x2A\x86\x48\x86\xF7\x0D" into "1.2.840.113549")

Parameters:
bufbuffer to put representation in
sizesize of the buffer
oidOID to translate
Returns:
Length of the string written (excluding final NULL) or POLARSSL_ERR_OID_BUF_TO_SMALL in case of error

Definition at line 644 of file oid.c.

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.

Parameters:
grp_idEC group identifier
oidplace to store ASN.1 OID string pointer
olenlength of the OID
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_oid_by_md ( md_type_t  md_alg,
const char **  oid,
size_t *  olen 
)

Translate md_type into hash algorithm OID.

Parameters:
md_algmessage digest algorithm
oidplace to store ASN.1 OID string pointer
olenlength of the OID
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_oid_by_pk_alg ( pk_type_t  pk_alg,
const char **  oid,
size_t *  olen 
)

Translate pk_type into PublicKeyAlgorithm OID.

Parameters:
pk_algPublic key type to look for
oidplace to store ASN.1 OID string pointer
olenlength of the OID
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
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.

Parameters:
md_algmessage digest algorithm
pk_algpublic key algorithm
oidplace to store ASN.1 OID string pointer
olenlength of the OID
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_pk_alg ( const asn1_buf oid,
pk_type_t pk_alg 
)

Translate PublicKeyAlgorithm OID into pk_type.

Parameters:
oidOID to use
pk_algplace to store public key algorithm
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
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.

Parameters:
oidOID to use
md_algplace to store message digest algorithm
cipher_algplace to store cipher algorithm
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
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.

Parameters:
oidOID to use
md_algplace to store message digest algorithm
pk_algplace to store public key algorithm
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_sig_alg_desc ( const asn1_buf oid,
const char **  desc 
)

Translate SignatureAlgorithm OID into description.

Parameters:
oidOID to use
descplace to store string pointer
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND
int oid_get_x509_ext_type ( const asn1_buf oid,
int *  ext_type 
)

Translate an X.509 extension OID into local values.

Parameters:
oidOID to use
ext_typeplace to store the extension type
Returns:
0 if successful, or POLARSSL_ERR_OID_NOT_FOUND