[][src]Struct rpki::csr::Csr

pub struct Csr { /* fields omitted */ }

An RPKI Certificate Sign Request.

Methods

impl Csr[src]

pub fn subject(&self) -> &Name[src]

The subject name included on the CSR.

TLDR; This field is useless and will be ignored by the issuing CA.

This field is required by RFC2986, but RFC6487 says that in the RPKI its value SHOULD be empty when requesting new certificates, and MAY be non-empty only on subsequent re-issuance requests and only if the issuing CA has adopted a policy that allows re-use of the name (implying, but not saying, that the request should then include the previously allocated name).

Issuing CAs MUST generate a unique name in the issued certificate.

pub fn public_key(&self) -> &PublicKey[src]

Returns the public key for the requested certificate. Note that validate() should be called to ensure that the requester has possession of the private key for this public key.

pub fn basic_ca(&self) -> bool[src]

Returns the cA field of the basic constraints extension if present, or false.

pub fn key_usage(&self) -> KeyUsage[src]

Returns the desired KeyUsage

pub fn extended_key_usage(&self) -> Option<&Captured>[src]

Returns the optional desired extended key usage.

pub fn ca_repository(&self) -> Option<&Rsync>[src]

Returns the desired ca repository

pub fn rpki_manifest(&self) -> Option<&Rsync>[src]

Returns the desired rpki manifest uri

pub fn rpki_notify(&self) -> Option<&Https>[src]

Returns the desired rpki notify uri (for RRDP)

impl Csr[src]

pub fn decode<S: Source>(source: S) -> Result<Self, S::Err>[src]

Parse as a source as a certificate signing request.

pub fn validate(&self) -> Result<(), ValidationError>[src]

Validates the CSR against its internal public key

impl Csr[src]

pub fn encode_ref<'a>(&'a self) -> impl Values + 'a[src]

Returns a value encoder for a reference to the csr.

pub fn to_captured(&self) -> Captured[src]

Returns a captured encoding of the csr.

impl Csr[src]

pub fn construct<S: Signer>(
    signer: &S,
    key: &S::KeyId,
    ca_repository: &Rsync,
    rpki_manifest: &Rsync,
    rpki_notify: Option<&Https>
) -> Result<Captured, SigningError<S::Error>>
[src]

Builds a new Csr for RPKI CA certificates.

Other use cases are not required in RPKI, and for simplicity they are not supported here. That means that BasicConstraints, KeyUsage, and algorithm do not need to be specified. Only the values for the required SIA entries for 'id-ad-caRepository' and 'id-ad-rpkiManifest' (see RFC6487), and the optional entry for 'id-ad-rpkiNotify' (see RFC8182), need to be specified.

Trait Implementations

impl Clone for Csr[src]

impl Debug for Csr[src]

impl<'de> Deserialize<'de> for Csr[src]

impl Serialize for Csr[src]

Auto Trait Implementations

impl RefUnwindSafe for Csr

impl Send for Csr

impl Sync for Csr

impl Unpin for Csr

impl UnwindSafe for Csr

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.