Struct pkcs8::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: ObjectIdentifierAlgorithm OID, i.e. the algorithm field in the AlgorithmIdentifier
ASN.1 schema.
parameters: Option<AnyRef<'a>>Algorithm parameters.
Implementations§
source§impl<'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 ObjectIdentifiers.
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<'a> Clone for AlgorithmIdentifier<'a>
 
impl<'a> Clone for AlgorithmIdentifier<'a>
source§fn clone(&self) -> AlgorithmIdentifier<'a>
 
fn clone(&self) -> AlgorithmIdentifier<'a>
1.0.0§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for AlgorithmIdentifier<'a>
 
impl<'a> Debug for AlgorithmIdentifier<'a>
source§impl<'a> DecodeValue<'a> for AlgorithmIdentifier<'a>
 
impl<'a> DecodeValue<'a> for AlgorithmIdentifier<'a>
source§fn 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>,
Reader.source§impl<'a> Ord for AlgorithmIdentifier<'a>
 
impl<'a> Ord for AlgorithmIdentifier<'a>
source§impl<'a> PartialEq for AlgorithmIdentifier<'a>
 
impl<'a> PartialEq for AlgorithmIdentifier<'a>
source§impl<'a> PartialOrd for AlgorithmIdentifier<'a>
 
impl<'a> PartialOrd for AlgorithmIdentifier<'a>
source§fn partial_cmp(&self, other: &AlgorithmIdentifier<'a>) -> Option<Ordering>
 
fn partial_cmp(&self, other: &AlgorithmIdentifier<'a>) -> Option<Ordering>
source§impl<'a> Sequence<'a> for AlgorithmIdentifier<'a>
 
impl<'a> Sequence<'a> for AlgorithmIdentifier<'a>
source§impl<'a> TryFrom<&'a [u8]> for AlgorithmIdentifier<'a>
 
impl<'a> TryFrom<&'a [u8]> for AlgorithmIdentifier<'a>
source§impl ValueOrd for AlgorithmIdentifier<'_>
 
impl ValueOrd for AlgorithmIdentifier<'_>
source§fn value_cmp(&self, other: &AlgorithmIdentifier<'_>) -> Result<Ordering, Error>
 
fn value_cmp(&self, other: &AlgorithmIdentifier<'_>) -> Result<Ordering, Error>
Ordering] between value portion of TLV-encoded self and
other when serialized as ASN.1 DER.impl<'a> Copy for AlgorithmIdentifier<'a>
impl<'a> Eq for AlgorithmIdentifier<'a>
impl<'a> StructuralPartialEq for AlgorithmIdentifier<'a>
Auto Trait Implementations§
impl<'a> Freeze for AlgorithmIdentifier<'a>
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§
§impl<T> Any for Twhere
    T: 'static + ?Sized,
 
impl<T> Any for Twhere
    T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
    T: ?Sized,
 
impl<T> Borrow<T> for Twhere
    T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
source§impl<'a, T> Choice<'a> for T
 
impl<'a, T> Choice<'a> for T
source§fn can_decode(tag: Tag) -> bool
 
fn can_decode(tag: Tag) -> bool
Tag decodable as a variant of this CHOICE?§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§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 dyn Writer) -> Result<(), Error>
 
fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer.