pub struct Asn1String(_);
Expand description

Primary ASN.1 type used by OpenSSL

Almost all ASN.1 types in OpenSSL are represented by ASN1_STRING structures. This implementation uses ASN1_STRING-to_UTF8 to preserve compatibility with Rust’s String.

Methods from Deref<Target = Asn1StringRef>

Converts the ASN.1 underlying format to UTF8

ASN.1 strings may utilize UTF-16, ASCII, BMP, or UTF8. This is important to consume the string in a meaningful way without knowing the underlying format.

This corresponds to ASN1_STRING_to_UTF8.

Return the string as an array of bytes.

The bytes do not directly correspond to UTF-8 encoding. To interact with strings in rust, it is preferable to use as_utf8

This corresponds to ASN1_STRING_get0_data.

Returns the number of bytes in the string.

This corresponds to ASN1_STRING_length.

Determines if the string is empty.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.
Immutably borrows from an owned value. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type. Read more
The raw C type.
The type representing a reference to this type.
Constructs an instance of this type from its raw type.
Returns a raw pointer to the wrapped value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.