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>
impl<'a> AlgorithmIdentifierRef<'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<'a> RefToOwned<'a> for AlgorithmIdentifierRef<'a>
Available on crate feature alloc
only.
impl<'a> RefToOwned<'a> for AlgorithmIdentifierRef<'a>
Available on crate feature
alloc
only.§type Owned = AlgorithmIdentifier<Any>
type Owned = AlgorithmIdentifier<Any>
The resulting type after obtaining ownership.
source§fn ref_to_owned(&self) -> Self::Owned
fn ref_to_owned(&self) -> Self::Owned
Creates a new object taking ownership of the data