Struct ed25519_dalek::pkcs8::spki::der::AnyRef
pub struct AnyRef<'a> { /* private fields */ }
pkcs8
only.Expand description
ASN.1 ANY
: represents any explicitly tagged ASN.1 value.
This is a zero-copy reference type which borrows from the input data.
Technically ANY
hasn’t been a recommended part of ASN.1 since the X.209
revision from 1988. It was deprecated and replaced by Information Object
Classes in X.680 in 1994, and X.690 no longer refers to it whatsoever.
Nevertheless, this crate defines an ANY
type as it remains a familiar
and useful concept which is still extensively used in things like
PKI-related RFCs.
Implementations§
§impl<'a> AnyRef<'a>
impl<'a> AnyRef<'a>
pub const NULL: AnyRef<'a> = Self{ tag: Tag::Null, value: ByteSlice::EMPTY,}
pub const NULL: AnyRef<'a> = Self{ tag: Tag::Null, value: ByteSlice::EMPTY,}
AnyRef
representation of the ASN.1 NULL
type.
pub fn decode_into<T>(self) -> Result<T, Error>where
T: DecodeValue<'a> + FixedTag,
pub fn decode_into<T>(self) -> Result<T, Error>where
T: DecodeValue<'a> + FixedTag,
Attempt to decode this AnyRef
type into the inner value.
pub fn bit_string(self) -> Result<BitStringRef<'a>, Error>
pub fn bit_string(self) -> Result<BitStringRef<'a>, Error>
Attempt to decode an ASN.1 BIT STRING
.
pub fn context_specific<T>(self) -> Result<ContextSpecific<T>, Error>where
T: Decode<'a>,
pub fn context_specific<T>(self) -> Result<ContextSpecific<T>, Error>where
T: Decode<'a>,
Attempt to decode an ASN.1 CONTEXT-SPECIFIC
field.
pub fn generalized_time(self) -> Result<GeneralizedTime, Error>
pub fn generalized_time(self) -> Result<GeneralizedTime, Error>
Attempt to decode an ASN.1 GeneralizedTime
.
pub fn ia5_string(self) -> Result<Ia5StringRef<'a>, Error>
pub fn ia5_string(self) -> Result<Ia5StringRef<'a>, Error>
Attempt to decode an ASN.1 IA5String
.
pub fn octet_string(self) -> Result<OctetStringRef<'a>, Error>
pub fn octet_string(self) -> Result<OctetStringRef<'a>, Error>
Attempt to decode an ASN.1 OCTET STRING
.
pub fn oid(self) -> Result<ObjectIdentifier, Error>
Available on crate feature oid
only.
pub fn oid(self) -> Result<ObjectIdentifier, Error>
oid
only.Attempt to decode an ASN.1 OBJECT IDENTIFIER
.
pub fn optional<T>(self) -> Result<Option<T>, Error>where
T: Choice<'a> + TryFrom<AnyRef<'a>, Error = Error>,
pub fn optional<T>(self) -> Result<Option<T>, Error>where
T: Choice<'a> + TryFrom<AnyRef<'a>, Error = Error>,
Attempt to decode an ASN.1 OPTIONAL
value.
pub fn printable_string(self) -> Result<PrintableStringRef<'a>, Error>
pub fn printable_string(self) -> Result<PrintableStringRef<'a>, Error>
Attempt to decode an ASN.1 PrintableString
.
pub fn teletex_string(self) -> Result<TeletexStringRef<'a>, Error>
pub fn teletex_string(self) -> Result<TeletexStringRef<'a>, Error>
Attempt to decode an ASN.1 TeletexString
.
pub fn videotex_string(self) -> Result<VideotexStringRef<'a>, Error>
pub fn videotex_string(self) -> Result<VideotexStringRef<'a>, Error>
Attempt to decode an ASN.1 VideotexString
.
pub fn sequence<F, T>(self, f: F) -> Result<T, Error>where
F: FnOnce(&mut SliceReader<'a>) -> Result<T, Error>,
pub fn sequence<F, T>(self, f: F) -> Result<T, Error>where
F: FnOnce(&mut SliceReader<'a>) -> Result<T, Error>,
Attempt to decode this value an ASN.1 SEQUENCE
, creating a new
nested reader and calling the provided argument with it.
pub fn utf8_string(self) -> Result<Utf8StringRef<'a>, Error>
pub fn utf8_string(self) -> Result<Utf8StringRef<'a>, Error>
Attempt to decode an ASN.1 UTF8String
.
Trait Implementations§
§impl<'a> Choice<'a> for AnyRef<'a>
impl<'a> Choice<'a> for AnyRef<'a>
§fn can_decode(_: Tag) -> bool
fn can_decode(_: Tag) -> bool
Tag
decodable as a variant of this CHOICE
?§impl EncodeValue for AnyRef<'_>
impl EncodeValue for AnyRef<'_>
§impl<'a> From<&'a ObjectIdentifier> for AnyRef<'a>
impl<'a> From<&'a ObjectIdentifier> for AnyRef<'a>
§fn from(oid: &'a ObjectIdentifier) -> AnyRef<'a>
fn from(oid: &'a ObjectIdentifier) -> AnyRef<'a>
§impl<'a> From<Ia5StringRef<'a>> for AnyRef<'a>
impl<'a> From<Ia5StringRef<'a>> for AnyRef<'a>
§fn from(printable_string: Ia5StringRef<'a>) -> AnyRef<'a>
fn from(printable_string: Ia5StringRef<'a>) -> AnyRef<'a>
§impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
impl<'a> From<OctetStringRef<'a>> for AnyRef<'a>
§fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
fn from(octet_string: OctetStringRef<'a>) -> AnyRef<'a>
§impl<'a> From<PrintableStringRef<'a>> for AnyRef<'a>
impl<'a> From<PrintableStringRef<'a>> for AnyRef<'a>
§fn from(printable_string: PrintableStringRef<'a>) -> AnyRef<'a>
fn from(printable_string: PrintableStringRef<'a>) -> AnyRef<'a>
§impl<'a> From<TeletexStringRef<'a>> for AnyRef<'a>
impl<'a> From<TeletexStringRef<'a>> for AnyRef<'a>
§fn from(teletex_string: TeletexStringRef<'a>) -> AnyRef<'a>
fn from(teletex_string: TeletexStringRef<'a>) -> AnyRef<'a>
§impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
impl<'a> From<Utf8StringRef<'a>> for AnyRef<'a>
§fn from(printable_string: Utf8StringRef<'a>) -> AnyRef<'a>
fn from(printable_string: Utf8StringRef<'a>) -> AnyRef<'a>
§impl<'a> From<VideotexStringRef<'a>> for AnyRef<'a>
impl<'a> From<VideotexStringRef<'a>> for AnyRef<'a>
§fn from(printable_string: VideotexStringRef<'a>) -> AnyRef<'a>
fn from(printable_string: VideotexStringRef<'a>) -> AnyRef<'a>
§impl<'a> Ord for AnyRef<'a>
impl<'a> Ord for AnyRef<'a>
§impl<'a> PartialEq<AnyRef<'a>> for AnyRef<'a>
impl<'a> PartialEq<AnyRef<'a>> for AnyRef<'a>
§impl<'a> PartialOrd<AnyRef<'a>> for AnyRef<'a>
impl<'a> PartialOrd<AnyRef<'a>> for AnyRef<'a>
§fn partial_cmp(&self, other: &AnyRef<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &AnyRef<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl TryFrom<AnyRef<'_>> for GeneralizedTime
impl TryFrom<AnyRef<'_>> for GeneralizedTime
§impl TryFrom<AnyRef<'_>> for ObjectIdentifier
impl TryFrom<AnyRef<'_>> for ObjectIdentifier
§impl<'a> TryFrom<AnyRef<'a>> for BitStringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for BitStringRef<'a>
§impl<'a, T> TryFrom<AnyRef<'a>> for ContextSpecific<T>where
T: Decode<'a>,
impl<'a, T> TryFrom<AnyRef<'a>> for ContextSpecific<T>where
T: Decode<'a>,
§impl<'a> TryFrom<AnyRef<'a>> for Ia5StringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for Ia5StringRef<'a>
§impl<'a> TryFrom<AnyRef<'a>> for OctetStringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for OctetStringRef<'a>
§impl<'a> TryFrom<AnyRef<'a>> for PrintableStringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for PrintableStringRef<'a>
§impl<'a> TryFrom<AnyRef<'a>> for TeletexStringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for TeletexStringRef<'a>
§impl<'a> TryFrom<AnyRef<'a>> for Utf8StringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for Utf8StringRef<'a>
§impl<'a> TryFrom<AnyRef<'a>> for VideotexStringRef<'a>
impl<'a> TryFrom<AnyRef<'a>> for VideotexStringRef<'a>
impl<'a> Copy for AnyRef<'a>
impl<'a> Eq for AnyRef<'a>
impl<'a> StructuralEq for AnyRef<'a>
impl<'a> StructuralPartialEq for AnyRef<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for AnyRef<'a>
impl<'a> Send for AnyRef<'a>
impl<'a> Sync for AnyRef<'a>
impl<'a> Unpin for AnyRef<'a>
impl<'a> UnwindSafe for AnyRef<'a>
Blanket Implementations§
§impl<T> DerOrd for Twhere
T: EncodeValue + ValueOrd + Tagged,
impl<T> DerOrd for Twhere
T: EncodeValue + ValueOrd + Tagged,
§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
§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.
§fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.