Skip to main content

IdCsrInner

Struct IdCsrInner 

Source
pub struct IdCsrInner<S: Signature, P: PublicKey<S>> {
    pub version: PkcsVersion,
    pub subject: PolyprotoDistinguishedName,
    pub subject_public_key: P,
    pub capabilities: Capabilities,
    /* private fields */
}
Expand description

In the context of PKCS #10, this is a CertificationRequestInfo:

CertificationRequestInfo ::= SEQUENCE {
    version       INTEGER { v1(0) } (v1,...),
    subject       Name,
    subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
    attributes    [0] Attributes{{ CRIAttributes }}
}

Fields§

§version: PkcsVersion

PKCS#10 version. Default: 0 for PKCS#10 v1

§subject: PolyprotoDistinguishedName

Information about the subject (actor).

§subject_public_key: P

The subjects’ public key: PublicKey.

§capabilities: Capabilities

Capabilities requested by the subject.

Implementations§

Source§

impl<S: Signature, P: PublicKey<S>> IdCsrInner<S, P>

Source

pub fn new( subject: &PolyprotoDistinguishedName, public_key: &P, capabilities: &Capabilities, ) -> Result<IdCsrInner<S, P>, CertificateConversionError>

Creates a new IdCsrInner.

§Errors

This method returns an error if the resulting IdCsrInner does not pass validation.

Source

pub fn from_der_unchecked( bytes: &[u8], ) -> Result<Self, CertificateConversionError>

Create an unchecked IdCsrInner from a byte slice containing a DER encoded PKCS #10 CSR.

§Errors

This method returns an error if:

  • The byte slice does not contain a valid DER encoded X.509 certification request info.
  • The certification request info cannot be converted to a polyproto IdCsrInner.
Source

pub fn to_der(self) -> Result<Vec<u8>, CertificateConversionError>

Encode this type as DER, returning a byte vector.

§Errors

This method returns an error if the inner CSR cannot be converted to the underlying X.509 type or if the DER encoding fails.

Trait Implementations§

Source§

impl<S: Clone + Signature, P: Clone + PublicKey<S>> Clone for IdCsrInner<S, P>

Source§

fn clone(&self) -> IdCsrInner<S, P>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug + Signature, P: Debug + PublicKey<S>> Debug for IdCsrInner<S, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: Eq + Signature, P: Eq + PublicKey<S>> Eq for IdCsrInner<S, P>

Source§

impl<S: Signature, P: PublicKey<S>> From<IdCsrInnerActor<S, P>> for IdCsrInner<S, P>

Source§

fn from(v: IdCsrInnerActor<S, P>) -> Self

Converts to this type from the input type.
Source§

impl<S: Signature, P: PublicKey<S>> From<IdCsrInnerHs<S, P>> for IdCsrInner<S, P>

Source§

fn from(v: IdCsrInnerHs<S, P>) -> Self

Converts to this type from the input type.
Source§

impl<S: PartialEq + Signature, P: PartialEq + PublicKey<S>> PartialEq for IdCsrInner<S, P>

Source§

fn eq(&self, other: &IdCsrInner<S, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: PartialEq + Signature, P: PartialEq + PublicKey<S>> StructuralPartialEq for IdCsrInner<S, P>

Source§

impl<S: Signature, P: PublicKey<S>> TryFrom<CertReqInfo> for IdCsrInner<S, P>

Source§

type Error = CertificateConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: CertReqInfo) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<S: Signature, P: PublicKey<S>> TryFrom<IdCsrInner<S, P>> for IdCsrInnerActor<S, P>

Source§

type Error = InvalidInput

The type returned in the event of a conversion error.
Source§

fn try_from(value: IdCsrInner<S, P>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<S: Signature, P: PublicKey<S>> TryFrom<IdCsrInner<S, P>> for IdCsrInnerHs<S, P>

Source§

type Error = InvalidInput

The type returned in the event of a conversion error.
Source§

fn try_from(value: IdCsrInner<S, P>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<S: Signature, P: PublicKey<S>> TryFrom<IdCsrInner<S, P>> for CertReqInfo

Source§

type Error = CertificateConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: IdCsrInner<S, P>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<S, P> Freeze for IdCsrInner<S, P>
where P: Freeze,

§

impl<S, P> RefUnwindSafe for IdCsrInner<S, P>

§

impl<S, P> Send for IdCsrInner<S, P>
where P: Send, S: Send,

§

impl<S, P> Sync for IdCsrInner<S, P>
where P: Sync, S: Sync,

§

impl<S, P> Unpin for IdCsrInner<S, P>
where P: Unpin, S: Unpin,

§

impl<S, P> UnsafeUnpin for IdCsrInner<S, P>
where P: UnsafeUnpin,

§

impl<S, P> UnwindSafe for IdCsrInner<S, P>
where P: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.