mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Add function to parse an OID from a string
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@@ -466,6 +466,20 @@ typedef struct mbedtls_oid_descriptor_t {
|
||||
*/
|
||||
int mbedtls_oid_get_numeric_string(char *buf, size_t size, const mbedtls_asn1_buf *oid);
|
||||
|
||||
/**
|
||||
* \brief Translate a string containing a numeric representation
|
||||
* of an ASN.1 OID into its encoded form
|
||||
* (e.g. "1.2.840.113549" into "\x2A\x86\x48\x86\xF7\x0D")
|
||||
*
|
||||
* \param buf buffer to put representation in
|
||||
* \param size size of the buffer
|
||||
* \param oid OID to translate
|
||||
*
|
||||
* \return Length of the string written (excluding final NULL) or
|
||||
* MBEDTLS_ERR_OID_BUF_TOO_SMALL in case of error
|
||||
*/
|
||||
int mbedtls_oid_from_numeric_string(mbedtls_asn1_buf *oid, const char *buf, size_t size);
|
||||
|
||||
/**
|
||||
* \brief Translate an X.509 extension OID into local values
|
||||
*
|
||||
|
Reference in New Issue
Block a user