Struct ed25519_dalek::pkcs8::spki::AlgorithmIdentifier
pub struct AlgorithmIdentifier<Params> {
pub oid: ObjectIdentifier,
pub parameters: Option<Params>,
}
pkcs8
only.Expand description
X.509 AlgorithmIdentifier
as defined in RFC 5280 Section 4.1.1.2.
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
Fields§
§oid: ObjectIdentifier
Algorithm OID, i.e. the algorithm
field in the AlgorithmIdentifier
ASN.1 schema.
parameters: Option<Params>
Algorithm parameters
.
Implementations§
§impl<Params> AlgorithmIdentifier<Params>
impl<Params> AlgorithmIdentifier<Params>
pub fn assert_algorithm_oid(
&self,
expected_oid: ObjectIdentifier
) -> Result<ObjectIdentifier, Error>
pub fn assert_algorithm_oid( &self, expected_oid: ObjectIdentifier ) -> Result<ObjectIdentifier, Error>
Assert the algorithm
OID is an expected value.
§impl<'a> AlgorithmIdentifier<AnyRef<'a>>
impl<'a> AlgorithmIdentifier<AnyRef<'a>>
pub fn assert_parameters_oid(
&self,
expected_oid: ObjectIdentifier
) -> Result<ObjectIdentifier, Error>
pub fn assert_parameters_oid( &self, expected_oid: ObjectIdentifier ) -> Result<ObjectIdentifier, Error>
Assert parameters
is an OID and has the expected value.
pub fn assert_oids(
&self,
algorithm: ObjectIdentifier,
parameters: ObjectIdentifier
) -> Result<(), Error>
pub fn assert_oids( &self, algorithm: ObjectIdentifier, parameters: ObjectIdentifier ) -> Result<(), Error>
Assert the values of the algorithm
and parameters
OIDs.
pub fn parameters_any(&self) -> Result<AnyRef<'a>, Error>
pub fn parameters_any(&self) -> Result<AnyRef<'a>, Error>
Get the parameters
field as an AnyRef
.
Returns an error if parameters
are None
.
pub fn parameters_oid(&self) -> Result<ObjectIdentifier, Error>
pub fn parameters_oid(&self) -> Result<ObjectIdentifier, Error>
Get the parameters
field as an ObjectIdentifier
.
Returns an error if it is absent or not an OID.
pub fn oids(
&self
) -> Result<(ObjectIdentifier, Option<ObjectIdentifier>), Error>
pub fn oids( &self ) -> Result<(ObjectIdentifier, Option<ObjectIdentifier>), Error>
Convert to a pair of ObjectIdentifier
s.
This method is helpful for decomposing in match statements. Note in
particular that NULL
parameters are treated the same as missing
parameters.
Returns an error if parameters are present but not an OID.
Trait Implementations§
§impl<Params> Clone for AlgorithmIdentifier<Params>where
Params: Clone,
impl<Params> Clone for AlgorithmIdentifier<Params>where
Params: Clone,
§fn clone(&self) -> AlgorithmIdentifier<Params>
fn clone(&self) -> AlgorithmIdentifier<Params>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<Params> Debug for AlgorithmIdentifier<Params>where
Params: Debug,
impl<Params> Debug for AlgorithmIdentifier<Params>where
Params: Debug,
§impl<'a, Params> DecodeValue<'a> for AlgorithmIdentifier<Params>where
Params: Choice<'a>,
impl<'a, Params> DecodeValue<'a> for AlgorithmIdentifier<Params>where
Params: Choice<'a>,
§fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<AlgorithmIdentifier<Params>, Error>where
R: Reader<'a>,
fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<AlgorithmIdentifier<Params>, Error>where
R: Reader<'a>,
Reader
.§impl<Params> EncodeValue for AlgorithmIdentifier<Params>where
Params: Encode,
impl<Params> EncodeValue for AlgorithmIdentifier<Params>where
Params: Encode,
§impl<Params> Ord for AlgorithmIdentifier<Params>where
Params: Ord,
impl<Params> Ord for AlgorithmIdentifier<Params>where
Params: Ord,
§fn cmp(&self, other: &AlgorithmIdentifier<Params>) -> Ordering
fn cmp(&self, other: &AlgorithmIdentifier<Params>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl OwnedToRef for AlgorithmIdentifier<Any>
impl OwnedToRef for AlgorithmIdentifier<Any>
§type Borrowed<'a> = AlgorithmIdentifier<AnyRef<'a>>
type Borrowed<'a> = AlgorithmIdentifier<AnyRef<'a>>
§fn owned_to_ref(&self) -> <AlgorithmIdentifier<Any> as OwnedToRef>::Borrowed<'_>
fn owned_to_ref(&self) -> <AlgorithmIdentifier<Any> as OwnedToRef>::Borrowed<'_>
§impl<Params> PartialEq for AlgorithmIdentifier<Params>where
Params: PartialEq,
impl<Params> PartialEq for AlgorithmIdentifier<Params>where
Params: PartialEq,
§fn eq(&self, other: &AlgorithmIdentifier<Params>) -> bool
fn eq(&self, other: &AlgorithmIdentifier<Params>) -> bool
self
and other
values to be equal, and is used
by ==
.§impl<Params> PartialOrd for AlgorithmIdentifier<Params>where
Params: PartialOrd,
impl<Params> PartialOrd for AlgorithmIdentifier<Params>where
Params: PartialOrd,
§fn partial_cmp(&self, other: &AlgorithmIdentifier<Params>) -> Option<Ordering>
fn partial_cmp(&self, other: &AlgorithmIdentifier<Params>) -> 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<'a> RefToOwned<'a> for AlgorithmIdentifier<AnyRef<'a>>
impl<'a> RefToOwned<'a> for AlgorithmIdentifier<AnyRef<'a>>
§type Owned = AlgorithmIdentifier<Any>
type Owned = AlgorithmIdentifier<Any>
§fn ref_to_owned(
&self
) -> <AlgorithmIdentifier<AnyRef<'a>> as RefToOwned<'a>>::Owned
fn ref_to_owned( &self ) -> <AlgorithmIdentifier<AnyRef<'a>> as RefToOwned<'a>>::Owned
§impl<'a, Params> TryFrom<&'a [u8]> for AlgorithmIdentifier<Params>
impl<'a, Params> TryFrom<&'a [u8]> for AlgorithmIdentifier<Params>
§impl<Params> ValueOrd for AlgorithmIdentifier<Params>where
Params: DerOrd,
impl<Params> ValueOrd for AlgorithmIdentifier<Params>where
Params: DerOrd,
impl<Params> Copy for AlgorithmIdentifier<Params>where
Params: Copy,
impl<Params> Eq for AlgorithmIdentifier<Params>where
Params: Eq,
impl<'a, Params> Sequence<'a> for AlgorithmIdentifier<Params>
impl<Params> StructuralPartialEq for AlgorithmIdentifier<Params>
Auto Trait Implementations§
impl<Params> RefUnwindSafe for AlgorithmIdentifier<Params>where
Params: RefUnwindSafe,
impl<Params> Send for AlgorithmIdentifier<Params>where
Params: Send,
impl<Params> Sync for AlgorithmIdentifier<Params>where
Params: Sync,
impl<Params> Unpin for AlgorithmIdentifier<Params>where
Params: Unpin,
impl<Params> UnwindSafe for AlgorithmIdentifier<Params>where
Params: UnwindSafe,
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
§impl<'a, T> Choice<'a> for T
impl<'a, T> Choice<'a> for T
§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Tag
decodable as a variant of this CHOICE
?§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
§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 impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.