Embed: (wiki syntax)

« Back to documentation index

x509.h File Reference

x509.h File Reference

X.509 generic defines and structures. More...

Go to the source code of this file.

Data Structures

struct  mbedtls_x509_time
 Container for date and time (precision in seconds). More...

Typedefs

Structures for parsing X.509 certificates, CRLs and CSRs
typedef mbedtls_asn1_buf mbedtls_x509_buf
 Type-length-value structure that allows for ASN1 using DER.
typedef mbedtls_asn1_bitstring mbedtls_x509_bitstring
 Container for ASN1 bit strings.
typedef mbedtls_asn1_named_data mbedtls_x509_name
 Container for ASN1 named information objects.
typedef mbedtls_asn1_sequence mbedtls_x509_sequence
 Container for a sequence of ASN.1 items.
typedef struct mbedtls_x509_time mbedtls_x509_time
 Container for date and time (precision in seconds).

Functions

int mbedtls_x509_dn_gets (char *buf, size_t size, const mbedtls_x509_name *dn)
 Store the certificate DN in printable form into buf; no more than size characters will be written.
int mbedtls_x509_serial_gets (char *buf, size_t size, const mbedtls_x509_buf *serial)
 Store the certificate serial in printable form into buf; no more than size characters will be written.
int mbedtls_x509_time_is_past (const mbedtls_x509_time *to)
 Check a given mbedtls_x509_time against the system time and tell if it's in the past.
int mbedtls_x509_time_is_future (const mbedtls_x509_time *from)
 Check a given mbedtls_x509_time against the system time and tell if it's in the future.
int mbedtls_x509_self_test (int verbose)
 Checkup routine.

Detailed Description

X.509 generic defines and structures.

Definition in file x509.h.


Function Documentation

int mbedtls_x509_dn_gets ( char *  buf,
size_t  size,
const mbedtls_x509_name dn 
)

Store the certificate DN in printable form into buf; no more than size characters will be written.

Parameters:
bufBuffer to write to
sizeMaximum size of buffer
dnThe X509 name to represent
Returns:
The length of the string written (not including the terminated nul byte), or a negative error code.

Definition at line 748 of file x509.c.

int mbedtls_x509_self_test ( int  verbose )

Checkup routine.

Returns:
0 if successful, or 1 if the test failed

Definition at line 1042 of file x509.c.

int mbedtls_x509_serial_gets ( char *  buf,
size_t  size,
const mbedtls_x509_buf serial 
)

Store the certificate serial in printable form into buf; no more than size characters will be written.

Parameters:
bufBuffer to write to
sizeMaximum size of buffer
serialThe X509 serial to represent
Returns:
The length of the string written (not including the terminated nul byte), or a negative error code.

Definition at line 810 of file x509.c.

int mbedtls_x509_time_is_future ( const mbedtls_x509_time from )

Check a given mbedtls_x509_time against the system time and tell if it's in the future.

Note:
Intended usage is "if( is_future( valid_from ) ) ERROR". Hence the return value of 1 if on internal errors.
Parameters:
frommbedtls_x509_time to check
Returns:
1 if the given time is in the future or an error occured, 0 otherwise.

Definition at line 1027 of file x509.c.

int mbedtls_x509_time_is_past ( const mbedtls_x509_time to )

Check a given mbedtls_x509_time against the system time and tell if it's in the past.

Note:
Intended usage is "if( is_past( valid_to ) ) ERROR". Hence the return value of 1 if on internal errors.
Parameters:
tombedtls_x509_time to check
Returns:
1 if the given time is in the past or an error occured, 0 otherwise.

Definition at line 1021 of file x509.c.