[][src]Struct rpki::crypto::keys::PublicKeyFormat

pub struct PublicKeyFormat;

The formats of public keys used by RPKI.

Currently, RPKI uses exactly one type of public keys, RSA keys with a size of 2048 bits. However, as that might change in the future, we are not hard-coding that format but rather use this type – which for the time being is zero-sized.

Methods

impl PublicKeyFormat[src]

ASN.1 Algorithm Identifiers

The format of the public key is identified in certificates through a algorithm identifier defined with this ASN.1:

AlgorithmIdentifier ::= SEQUENCE {
     algorithm          OBJECT IDENTIFIER,
     parameters         ANY DEFINED BY algorithm OPTIONAL }

Right now, the object identifier needs to be that of rsaEncryption defined by RFC 4055 and the parameters must be present and NULL. Then parsing, we generously also allow it to be absent altogether.

The functions and methods in this section allow decoding and encoding of these identifiers.

pub fn take_from<S: Source>(cons: &mut Constructed<S>) -> Result<Self, S::Err>[src]

Takes and returns a algorithm identifier.

Returns a malformed error if the algorithm isn’t one of the allowed algorithms or if the value isn’t correctly encoded.

pub fn encode(self) -> impl Values[src]

Provides an encoder for the algorihm identifier.

Trait Implementations

impl Copy for PublicKeyFormat[src]

impl PartialEq<PublicKeyFormat> for PublicKeyFormat[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for PublicKeyFormat[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for PublicKeyFormat[src]

impl Debug for PublicKeyFormat[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.