pub enum DirectoryString {
PrintableString(PrintableString),
TeletexString(TeletexString),
Utf8String(String),
}
Expand description
DirectoryString as defined in RFC 5280 Section 4.2.1.4.
ASN.1 structure for DirectoryString is below.
DirectoryString ::= CHOICE {
teletexString TeletexString (SIZE (1..MAX)),
printableString PrintableString (SIZE (1..MAX)),
universalString UniversalString (SIZE (1..MAX)),
utf8String UTF8String (SIZE (1..MAX)),
bmpString BMPString (SIZE (1..MAX))
}
Further, RFC 5280 Section 4.2.1.4 states:
The DirectoryString type is defined as a choice of PrintableString,
TeletexString, BMPString, UTF8String, and UniversalString. CAs
conforming to this profile MUST use either the PrintableString or
UTF8String encoding of DirectoryString, with two exceptions. When
CAs have previously issued certificates with issuer fields with
attributes encoded using TeletexString, BMPString, or
UniversalString, then the CA MAY continue to use these encodings of
the DirectoryString to preserve backward compatibility. Also, new
CAs that are added to a domain where existing CAs issue certificates
with issuer fields with attributes encoded using TeletexString,
BMPString, or UniversalString MAY encode attributes that they share
with the existing CAs using the same encodings as the existing CAs
use.
The implication of the above paragraph is that PrintableString
and
UTF8String
are the new types and the other types are legacy. Until
the need arises, we only support PrintableString
and UTF8String
.
Variants§
Trait Implementations§
source§impl<'__der_lifetime> Choice<'__der_lifetime> for DirectoryString
impl<'__der_lifetime> Choice<'__der_lifetime> for DirectoryString
source§impl Clone for DirectoryString
impl Clone for DirectoryString
source§fn clone(&self) -> DirectoryString
fn clone(&self) -> DirectoryString
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DirectoryString
impl Debug for DirectoryString
source§impl<'__der_lifetime> Decode<'__der_lifetime> for DirectoryString
impl<'__der_lifetime> Decode<'__der_lifetime> for DirectoryString
source§impl EncodeValue for DirectoryString
impl EncodeValue for DirectoryString
source§impl PartialEq for DirectoryString
impl PartialEq for DirectoryString
source§fn eq(&self, other: &DirectoryString) -> bool
fn eq(&self, other: &DirectoryString) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Tagged for DirectoryString
impl Tagged for DirectoryString
source§impl ValueOrd for DirectoryString
impl ValueOrd for DirectoryString
impl Eq for DirectoryString
impl StructuralEq for DirectoryString
impl StructuralPartialEq for DirectoryString
Auto Trait Implementations§
impl RefUnwindSafe for DirectoryString
impl Send for DirectoryString
impl Sync for DirectoryString
impl Unpin for DirectoryString
impl UnwindSafe for DirectoryString
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.