Type Alias spki::AlgorithmIdentifierRef

source ·
pub type AlgorithmIdentifierRef<'a> = AlgorithmIdentifier<AnyRef<'a>>;
Expand description

AlgorithmIdentifier reference which has AnyRef parameters.

Aliased Type§

struct AlgorithmIdentifierRef<'a> {
    pub oid: ObjectIdentifier,
    pub parameters: Option<AnyRef<'a>>,
}

Fields§

§oid: ObjectIdentifier

Algorithm OID, i.e. the algorithm field in the AlgorithmIdentifier ASN.1 schema.

§parameters: Option<AnyRef<'a>>

Algorithm parameters.

Implementations§

source§

impl<'a> AlgorithmIdentifierRef<'a>

source

pub fn assert_parameters_oid( &self, expected_oid: ObjectIdentifier, ) -> Result<ObjectIdentifier>

Assert parameters is an OID and has the expected value.

source

pub fn assert_oids( &self, algorithm: ObjectIdentifier, parameters: ObjectIdentifier, ) -> Result<()>

Assert the values of the algorithm and parameters OIDs.

source

pub fn parameters_any(&self) -> Result<AnyRef<'a>>

Get the parameters field as an AnyRef.

Returns an error if parameters are None.

source

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.

source

pub fn oids(&self) -> Result<(ObjectIdentifier, Option<ObjectIdentifier>)>

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> RefToOwned<'a> for AlgorithmIdentifierRef<'a>

§

type Owned = AlgorithmIdentifier<Any>

The resulting type after obtaining ownership.
source§

fn ref_to_owned(&self) -> Self::Owned

Creates a new object taking ownership of the data