Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: blinky_max32630fthr
crypto_misc.h File Reference
Go to the source code of this file.
Functions | |
| int | x509_new (const uint8_t *cert, int *len, X509_CTX **ctx) |
| Construct a new x509 object. | |
| void | x509_free (X509_CTX *x509_ctx) |
| Free an X.509 object's resources. | |
| int | x509_verify (const CA_CERT_CTX *ca_cert_ctx, const X509_CTX *cert) |
| Do some basic checks on the certificate chain. | |
| int | asn1_get_private_key (const uint8_t *buf, int len, RSA_CTX **rsa_ctx) |
| Get all the RSA private key specifics from an ASN.1 encoded file. | |
| int | asn1_next_obj (const uint8_t *buf, int *offset, int obj_type) |
| Skip the ASN1.1 object type and its length. | |
| int | asn1_skip_obj (const uint8_t *buf, int *offset, int obj_type) |
| Skip over an ASN.1 object type completely. | |
| int | asn1_get_int (const uint8_t *buf, int *offset, uint8_t **object) |
| Read an integer value for ASN.1 data Note: This function allocates memory which must be freed by the user. | |
| int | asn1_version (const uint8_t *cert, int *offset, X509_CTX *x509_ctx) |
| Get the version type of a certificate (which we don't actually care about) | |
| int | asn1_validity (const uint8_t *cert, int *offset, X509_CTX *x509_ctx) |
| Retrieve the notbefore and notafter certificate times. | |
| int | asn1_name (const uint8_t *cert, int *offset, char *dn[]) |
| Get the subject name (or the issuer) of a certificate. | |
| int | asn1_public_key (const uint8_t *cert, int *offset, X509_CTX *x509_ctx) |
| Read the modulus and public exponent of a certificate. | |
| int | asn1_signature (const uint8_t *cert, int *offset, X509_CTX *x509_ctx) |
| Read the signature of the certificate. | |
| int | asn1_signature_type (const uint8_t *cert, int *offset, X509_CTX *x509_ctx) |
| Read the signature type of the certificate. | |
| int | get_file (const char *filename, uint8_t **buf) |
| Retrieve a file and put it into memory. | |
| EXP_FUNC void STDCALL | print_blob (const char *format, const uint8_t *data, int size,...) |
| Spit out a blob of data for diagnostics. | |
Detailed Description
Definition in file crypto_misc.h.
Function Documentation
| int asn1_get_int | ( | const uint8_t * | buf, |
| int * | offset, | ||
| uint8_t ** | object | ||
| ) |
| int asn1_get_private_key | ( | const uint8_t * | buf, |
| int | len, | ||
| RSA_CTX ** | rsa_ctx | ||
| ) |
| int asn1_name | ( | const uint8_t * | cert, |
| int * | offset, | ||
| char * | dn[] | ||
| ) |
| int asn1_next_obj | ( | const uint8_t * | buf, |
| int * | offset, | ||
| int | obj_type | ||
| ) |
| int asn1_public_key | ( | const uint8_t * | cert, |
| int * | offset, | ||
| X509_CTX * | x509_ctx | ||
| ) |
| int asn1_signature | ( | const uint8_t * | cert, |
| int * | offset, | ||
| X509_CTX * | x509_ctx | ||
| ) |
| int asn1_signature_type | ( | const uint8_t * | cert, |
| int * | offset, | ||
| X509_CTX * | x509_ctx | ||
| ) |
| int asn1_skip_obj | ( | const uint8_t * | buf, |
| int * | offset, | ||
| int | obj_type | ||
| ) |
| int asn1_validity | ( | const uint8_t * | cert, |
| int * | offset, | ||
| X509_CTX * | x509_ctx | ||
| ) |
| int asn1_version | ( | const uint8_t * | cert, |
| int * | offset, | ||
| X509_CTX * | x509_ctx | ||
| ) |
| int get_file | ( | const char * | filename, |
| uint8_t ** | buf | ||
| ) |
Retrieve a file and put it into memory.
- Returns:
- The size of the file, or -1 on failure.
Definition at line 71 of file crypto_misc.c.
| EXP_FUNC void STDCALL print_blob | ( | const char * | format, |
| const uint8_t * | data, | ||
| int | size, | ||
| ... | |||
| ) |
Spit out a blob of data for diagnostics.
The data is is a nice column format for easy reading.
- Parameters:
-
format [in] The string (with possible embedded format characters) size [in] The number of numbers to print data [in] The start of data to use ... [in] Any additional arguments
Definition at line 274 of file crypto_misc.c.
| void x509_free | ( | X509_CTX * | x509_ctx ) |
Free an X.509 object's resources.
Definition at line 222 of file unsupported/net/https/axTLS/ssl/x509.c.
| int x509_new | ( | const uint8_t * | cert, |
| int * | len, | ||
| X509_CTX ** | ctx | ||
| ) |
Construct a new x509 object.
- Returns:
- 0 if ok. < 0 if there was a problem.
Definition at line 73 of file unsupported/net/https/axTLS/ssl/x509.c.
| int x509_verify | ( | const CA_CERT_CTX * | ca_cert_ctx, |
| const X509_CTX * | cert | ||
| ) |
Do some basic checks on the certificate chain.
Certificate verification consists of a number of checks:
- The date of the certificate is after the start date.
- The date of the certificate is before the finish date.
- A root certificate exists in the certificate store.
- That the certificate(s) are not self-signed.
- The certificate chain is valid.
- The signature of the certificate is valid.
Definition at line 313 of file unsupported/net/https/axTLS/ssl/x509.c.
Generated on Tue Jul 12 2022 14:21:26 by
1.7.2