mbedtls ported to mbed-classic

Fork of mbedtls by Christopher Haster

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 *time)
 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 *time)
 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.

Copyright (C) 2006-2015, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

This file is part of mbed TLS (https://tls.mbed.org)

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 668 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 962 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 730 of file x509.c.

int mbedtls_x509_time_is_future ( const mbedtls_x509_time time )

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:
timembedtls_x509_time to check
Returns:
1 if the given time is in the future or an error occured, 0 otherwise.

Definition at line 947 of file x509.c.

int mbedtls_x509_time_is_past ( const mbedtls_x509_time time )

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:
timembedtls_x509_time to check
Returns:
1 if the given time is in the past or an error occured, 0 otherwise.

Definition at line 941 of file x509.c.