Struct pkcs8::AlgorithmIdentifier
source · [−]pub struct AlgorithmIdentifier<'a> {
pub oid: ObjectIdentifier,
pub parameters: Option<Any<'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<Any<'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<Any<'a>, Error>
pub fn parameters_any(&self) -> Result<Any<'a>, Error>
Get the parameters
field as an Any
.
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.
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> Message<'a> for AlgorithmIdentifier<'a>
impl<'a> Message<'a> 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> TryFrom<&'a [u8]> for AlgorithmIdentifier<'a>
impl<'a> TryFrom<&'a [u8]> for AlgorithmIdentifier<'a>
sourceimpl<'a> TryFrom<Any<'a>> for AlgorithmIdentifier<'a>
impl<'a> TryFrom<Any<'a>> for AlgorithmIdentifier<'a>
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: Decodable<'a> + Encodable + Tagged,
impl<'a, T> Choice<'a> for T where
T: Decodable<'a> + Encodable + Tagged,
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, M> Encodable for M where
M: Message<'a>,
impl<'a, M> Encodable for M where
M: Message<'a>,
sourcefn 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.
sourcefn encode(&self, encoder: &mut Encoder<'_>) -> Result<(), Error>
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Encoder
.
sourcefn encode_to_slice(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice(&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. Read more