Struct pkcs5::AlgorithmIdentifier
source · [−]pub struct AlgorithmIdentifier<'a> {
pub oid: ObjectIdentifier,
pub parameters: Option<AnyRef<'a>>,
}
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<AnyRef<'a>>
Algorithm parameters
.
Implementations
sourceimpl<'a> AlgorithmIdentifier<'a>
impl<'a> AlgorithmIdentifier<'a>
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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
.
sourcepub 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.
sourcepub 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
sourceimpl<'a> Clone for AlgorithmIdentifier<'a>
impl<'a> Clone for AlgorithmIdentifier<'a>
sourcefn clone(&self) -> AlgorithmIdentifier<'a>
fn clone(&self) -> AlgorithmIdentifier<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for AlgorithmIdentifier<'a>
impl<'a> Debug for AlgorithmIdentifier<'a>
sourceimpl<'a> DecodeValue<'a> for AlgorithmIdentifier<'a>
impl<'a> DecodeValue<'a> for AlgorithmIdentifier<'a>
sourcefn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<AlgorithmIdentifier<'a>, Error> where
R: Reader<'a>,
fn decode_value<R>(
reader: &mut R,
header: Header
) -> Result<AlgorithmIdentifier<'a>, Error> where
R: Reader<'a>,
Attempt to decode this message using the provided Reader
.
sourceimpl<'a> From<Pbkdf2Prf> for AlgorithmIdentifier<'a>
impl<'a> From<Pbkdf2Prf> for AlgorithmIdentifier<'a>
sourceimpl<'a> Ord for AlgorithmIdentifier<'a>
impl<'a> Ord for AlgorithmIdentifier<'a>
sourceimpl<'a> PartialEq<AlgorithmIdentifier<'a>> for AlgorithmIdentifier<'a>
impl<'a> PartialEq<AlgorithmIdentifier<'a>> for AlgorithmIdentifier<'a>
sourcefn eq(&self, other: &AlgorithmIdentifier<'a>) -> bool
fn eq(&self, other: &AlgorithmIdentifier<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AlgorithmIdentifier<'a>) -> bool
fn ne(&self, other: &AlgorithmIdentifier<'a>) -> bool
This method tests for !=
.
sourceimpl<'a> PartialOrd<AlgorithmIdentifier<'a>> for AlgorithmIdentifier<'a>
impl<'a> PartialOrd<AlgorithmIdentifier<'a>> for AlgorithmIdentifier<'a>
sourcefn partial_cmp(&self, other: &AlgorithmIdentifier<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &AlgorithmIdentifier<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<'a> Sequence<'a> for AlgorithmIdentifier<'a>
impl<'a> Sequence<'a> for AlgorithmIdentifier<'a>
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for Algorithm
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for Algorithm
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for Kdf<'a>
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for Kdf<'a>
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for Pbkdf2Prf
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for Pbkdf2Prf
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for EncryptionScheme<'a>
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for EncryptionScheme<'a>
sourceimpl<'a> TryFrom<AlgorithmIdentifier<'a>> for EncryptionScheme<'a>
impl<'a> TryFrom<AlgorithmIdentifier<'a>> for EncryptionScheme<'a>
sourcefn try_from(alg: AlgorithmIdentifier<'a>) -> Result<EncryptionScheme<'_>>
fn try_from(alg: AlgorithmIdentifier<'a>) -> Result<EncryptionScheme<'_>>
Performs the conversion.
sourceimpl<'a> TryFrom<EncryptionScheme<'a>> for AlgorithmIdentifier<'a>
impl<'a> TryFrom<EncryptionScheme<'a>> for AlgorithmIdentifier<'a>
sourceimpl<'_> ValueOrd for AlgorithmIdentifier<'_>
impl<'_> ValueOrd for AlgorithmIdentifier<'_>
impl<'a> Copy for AlgorithmIdentifier<'a>
impl<'a> Eq for AlgorithmIdentifier<'a>
impl<'a> StructuralEq for AlgorithmIdentifier<'a>
impl<'a> StructuralPartialEq for AlgorithmIdentifier<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for AlgorithmIdentifier<'a>
impl<'a> Send for AlgorithmIdentifier<'a>
impl<'a> Sync for AlgorithmIdentifier<'a>
impl<'a> Unpin for AlgorithmIdentifier<'a>
impl<'a> UnwindSafe for AlgorithmIdentifier<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
impl<'a, T> Choice<'a> for T where
T: Decode<'a> + FixedTag,
sourcefn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided Tag
decodable as a variant of this CHOICE
?
sourceimpl<'a, T> Decode<'a> for T where
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for T where
T: DecodeValue<'a> + FixedTag,
sourceimpl<T> DerOrd for T where
T: EncodeValue + ValueOrd + Tagged,
impl<T> DerOrd for T where
T: EncodeValue + ValueOrd + Tagged,
sourceimpl<T> Encode for T where
T: EncodeValue + Tagged,
impl<T> Encode for T where
T: EncodeValue + Tagged,
sourceimpl<'a, M> EncodeValue for M where
M: Sequence<'a>,
impl<'a, M> EncodeValue for M where
M: Sequence<'a>,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more