[−][src]Struct rpki::crypto::signature::SignatureAlgorithm
The signature algorihms used by RPKI.
These are the algorithms used for creating and verifying signatures. For RPKI, RFC 7935 allows only one algorithm, RSA PKCS #1 v1.5 with SHA-256. Because of that, this type is currently a zero-sized struct. Should additional algorithms ever be allowed, it will change into an enum.
Methods
impl SignatureAlgorithm
[src]
pub fn public_key_format(self) -> PublicKeyFormat
[src]
Returns the preferred public key format for this algorithm.
impl SignatureAlgorithm
[src]
ASN.1 Values
Signature algorithm identifiers appear in certificates and other objects from [RFC 5280] (simply as algorithm identifiers) as well as in signed objects.
SignatureAlgorithmIdentifier ::= AlgorithmIdentifier
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
Currently, RFC 7935 allows only one algorithm, but sadly it uses
different identifiers in different places. For X.509-related objects,
i.e., certificates, CRLs, and certification requests, this is
sha256WithRSAEncryption
from RFC 4055. For signed objects, the
identifier must be rsaEncryption
from RFC 3370 for constructed
objects while both must be accepted when reading objects.
Because of these differences, you’ll find two sets of functions and
methods in this section. Those prefixed with x509
deal with the
X.509-related identifiers while cms_
is the prefix for signed objects.
The parameters field for the former identifier can be either NULL or missing and must be NULL for the latter. We will, however, accept an absent field for the latter as well. When constructing identifiers, we will always include a parameters field and set it to NULL.
pub fn x509_take_from<S: Source>(
cons: &mut Constructed<S>
) -> Result<Self, S::Err>
[src]
cons: &mut Constructed<S>
) -> Result<Self, S::Err>
Takes a signature algorithm identifier for X.509 objects.
Returns a malformed error if the algorithm isn’t the allowed for RPKI or if it isn’t correctly encoded.
pub fn cms_take_from<S: Source>(
cons: &mut Constructed<S>
) -> Result<Self, S::Err>
[src]
cons: &mut Constructed<S>
) -> Result<Self, S::Err>
Takes a signature algorithm identifier for CMS objects.
Returns a malformed error if the algorithm isn’t the allowed for RPKI or if it isn’t correctly encoded.
pub fn x509_encode(self) -> impl Values
[src]
Provides an encoder for X.509 objects.
pub fn cms_encode(self) -> impl Values
[src]
Provides an encoder for CMS objects.
Trait Implementations
impl Copy for SignatureAlgorithm
[src]
impl PartialEq<SignatureAlgorithm> for SignatureAlgorithm
[src]
fn eq(&self, other: &SignatureAlgorithm) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for SignatureAlgorithm
[src]
fn clone(&self) -> SignatureAlgorithm
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for SignatureAlgorithm
[src]
impl Debug for SignatureAlgorithm
[src]
impl Hash for SignatureAlgorithm
[src]
Auto Trait Implementations
impl Send for SignatureAlgorithm
impl Sync for SignatureAlgorithm
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,