22 #ifndef MBEDTLS_ASN1_WRITE_H
23 #define MBEDTLS_ASN1_WRITE_H
29 #define MBEDTLS_ASN1_CHK_ADD(g, f) \
32 if( ( ret = (f) ) < 0 ) \
85 const unsigned char *buf,
size_t size );
87 #if defined(MBEDTLS_BIGNUM_C)
135 const char *
oid,
size_t oid_len );
153 const unsigned char *start,
154 const char *oid,
size_t oid_len,
222 int tag,
const char *text,
241 const unsigned char *start,
242 const char *text,
size_t text_len );
260 const char *text,
size_t text_len );
278 const char *text,
size_t text_len );
295 const unsigned char *buf,
size_t bits );
315 const unsigned char *start,
316 const unsigned char *buf,
334 const unsigned char *buf,
size_t size );
358 const char *oid,
size_t oid_len,
359 const unsigned char *val,
int mbedtls_asn1_write_octet_string(unsigned char **p, const unsigned char *start, const unsigned char *buf, size_t size)
Write an octet string tag (MBEDTLS_ASN1_OCTET_STRING) and value in ASN.1 format.
int mbedtls_asn1_write_len(unsigned char **p, const unsigned char *start, size_t len)
Write a length field in ASN.1 format.
int mbedtls_asn1_write_bool(unsigned char **p, const unsigned char *start, int boolean)
Write a boolean tag (MBEDTLS_ASN1_BOOLEAN) and value in ASN.1 format.
int mbedtls_asn1_write_printable_string(unsigned char **p, const unsigned char *start, const char *text, size_t text_len)
Write a string in ASN.1 format using the PrintableString string encoding tag (MBEDTLS_ASN1_PRINTABLE_...
int mbedtls_asn1_write_utf8_string(unsigned char **p, const unsigned char *start, const char *text, size_t text_len)
Write a UTF8 string in ASN.1 format using the UTF8String string encoding tag (MBEDTLS_ASN1_UTF8_STRIN...
int mbedtls_asn1_write_algorithm_identifier(unsigned char **p, const unsigned char *start, const char *oid, size_t oid_len, size_t par_len)
Write an AlgorithmIdentifier sequence in ASN.1 format.
int mbedtls_asn1_write_int(unsigned char **p, const unsigned char *start, int val)
Write an int tag (MBEDTLS_ASN1_INTEGER) and value in ASN.1 format.
int mbedtls_asn1_write_bitstring(unsigned char **p, const unsigned char *start, const unsigned char *buf, size_t bits)
Write a bitstring tag (MBEDTLS_ASN1_BIT_STRING) and value in ASN.1 format.
int mbedtls_asn1_write_null(unsigned char **p, const unsigned char *start)
Write a NULL tag (MBEDTLS_ASN1_NULL) with zero data in ASN.1 format.
Build-time configuration info.
int mbedtls_asn1_write_mpi(unsigned char **p, const unsigned char *start, const mbedtls_mpi *X)
Write a arbitrary-precision number (MBEDTLS_ASN1_INTEGER) in ASN.1 format.
int mbedtls_asn1_write_oid(unsigned char **p, const unsigned char *start, const char *oid, size_t oid_len)
Write an OID tag (MBEDTLS_ASN1_OID) and data in ASN.1 format.
int mbedtls_asn1_write_enum(unsigned char **p, const unsigned char *start, int val)
Write an enum tag (MBEDTLS_ASN1_ENUMERATED) and value in ASN.1 format.
int mbedtls_asn1_write_ia5_string(unsigned char **p, const unsigned char *start, const char *text, size_t text_len)
Write a string in ASN.1 format using the IA5String string encoding tag (MBEDTLS_ASN1_IA5_STRING).
mbedtls_asn1_named_data * mbedtls_asn1_store_named_data(mbedtls_asn1_named_data **list, const char *oid, size_t oid_len, const unsigned char *val, size_t val_len)
Create or find a specific named_data entry for writing in a sequence or list based on the OID...
int mbedtls_asn1_write_raw_buffer(unsigned char **p, const unsigned char *start, const unsigned char *buf, size_t size)
Write raw buffer data.
int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsigned char tag)
Write an ASN.1 tag in ASN.1 format.
int mbedtls_asn1_write_tagged_string(unsigned char **p, const unsigned char *start, int tag, const char *text, size_t text_len)
Write a string in ASN.1 format using a specific string encoding tag.
int mbedtls_asn1_write_named_bitstring(unsigned char **p, const unsigned char *start, const unsigned char *buf, size_t bits)
This function writes a named bitstring tag (MBEDTLS_ASN1_BIT_STRING) and value in ASN...