pub struct AlgorithmIdentifier<Params> {
pub oid: ObjectIdentifier,
pub parameters: Option<Params>,
}
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§
source§impl<Params> AlgorithmIdentifier<Params>
impl<Params> AlgorithmIdentifier<Params>
sourcepub fn assert_algorithm_oid(
&self,
expected_oid: ObjectIdentifier,
) -> Result<ObjectIdentifier>
pub fn assert_algorithm_oid( &self, expected_oid: ObjectIdentifier, ) -> Result<ObjectIdentifier>
Assert the algorithm
OID is an expected value.
source§impl<'a> AlgorithmIdentifier<AnyRef<'a>>
impl<'a> AlgorithmIdentifier<AnyRef<'a>>
sourcepub fn assert_parameters_oid(
&self,
expected_oid: ObjectIdentifier,
) -> Result<ObjectIdentifier>
pub fn assert_parameters_oid( &self, expected_oid: ObjectIdentifier, ) -> Result<ObjectIdentifier>
Assert parameters
is an OID and has the expected value.
sourcepub fn assert_oids(
&self,
algorithm: ObjectIdentifier,
parameters: ObjectIdentifier,
) -> Result<()>
pub fn assert_oids( &self, algorithm: ObjectIdentifier, parameters: ObjectIdentifier, ) -> Result<()>
Assert the values of the algorithm
and parameters
OIDs.
sourcepub fn parameters_any(&self) -> Result<AnyRef<'a>>
pub fn parameters_any(&self) -> Result<AnyRef<'a>>
Get the parameters
field as an AnyRef
.
Returns an error if parameters
are None
.
sourcepub fn parameters_oid(&self) -> Result<ObjectIdentifier>
pub fn parameters_oid(&self) -> Result<ObjectIdentifier>
Get the parameters
field as an ObjectIdentifier
.
Returns an error if it is absent or not an OID.
sourcepub fn oids(&self) -> Result<(ObjectIdentifier, Option<ObjectIdentifier>)>
pub fn oids(&self) -> Result<(ObjectIdentifier, Option<ObjectIdentifier>)>
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§
source§impl<Params: Clone> Clone for AlgorithmIdentifier<Params>
impl<Params: Clone> Clone for AlgorithmIdentifier<Params>
source§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 moresource§impl<Params: Debug> Debug for AlgorithmIdentifier<Params>
impl<Params: Debug> Debug for AlgorithmIdentifier<Params>
source§impl<'a, Params> DecodeValue<'a> for AlgorithmIdentifier<Params>where
Params: Choice<'a>,
impl<'a, Params> DecodeValue<'a> for AlgorithmIdentifier<Params>where
Params: Choice<'a>,
source§impl<Params> EncodeValue for AlgorithmIdentifier<Params>where
Params: Encode,
impl<Params> EncodeValue for AlgorithmIdentifier<Params>where
Params: Encode,
source§impl<Params: Ord> Ord for AlgorithmIdentifier<Params>
impl<Params: Ord> Ord for AlgorithmIdentifier<Params>
source§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,
source§impl<Params: PartialEq> PartialEq for AlgorithmIdentifier<Params>
impl<Params: PartialEq> PartialEq for AlgorithmIdentifier<Params>
source§impl<Params: PartialOrd> PartialOrd for AlgorithmIdentifier<Params>
impl<Params: PartialOrd> PartialOrd for AlgorithmIdentifier<Params>
source§impl<'a, Params> TryFrom<&'a [u8]> for AlgorithmIdentifier<Params>
impl<'a, Params> TryFrom<&'a [u8]> for AlgorithmIdentifier<Params>
source§impl<Params> ValueOrd for AlgorithmIdentifier<Params>where
Params: DerOrd,
impl<Params> ValueOrd for AlgorithmIdentifier<Params>where
Params: DerOrd,
impl<Params: Copy> Copy for AlgorithmIdentifier<Params>
impl<Params: Eq> Eq for AlgorithmIdentifier<Params>
impl<'a, Params> Sequence<'a> for AlgorithmIdentifier<Params>
impl<Params> StructuralPartialEq for AlgorithmIdentifier<Params>
Auto Trait Implementations§
impl<Params> Freeze for AlgorithmIdentifier<Params>where
Params: Freeze,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
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
.