Skip to main content

mbedtls_asn1_write_named_bitstring

Function mbedtls_asn1_write_named_bitstring 

Source
pub unsafe extern "C" fn mbedtls_asn1_write_named_bitstring(
    p: *mut *mut c_uchar,
    start: *const c_uchar,
    buf: *const c_uchar,
    bits: usize,
) -> c_int
Expand description

\brief This function writes a named bitstring tag (#MBEDTLS_ASN1_BIT_STRING) and value in ASN.1 format.

             As stated in RFC 5280 Appendix B, trailing zeroes are
             omitted when encoding named bitstrings in DER.

\note This function works backwards within the data buffer.

\param p The reference to the current position pointer. \param start The start of the buffer which is used for bounds-checking. \param buf The bitstring to write. \param bits The total number of bits in the bitstring.

\return The number of bytes written to \p p on success. \return A negative error code on failure.