pub struct X509Req(_);
Expand description
An X509
certificate request.
Implementations
sourceimpl X509Req
impl X509Req
sourcepub fn builder() -> Result<X509ReqBuilder, ErrorStack>
pub fn builder() -> Result<X509ReqBuilder, ErrorStack>
A builder for X509Req
.
sourcepub fn from_pem(pem: &[u8]) -> Result<X509Req, ErrorStack>
pub fn from_pem(pem: &[u8]) -> Result<X509Req, ErrorStack>
Deserializes a PEM-encoded PKCS#10 certificate request structure.
The input should have a header of -----BEGIN CERTIFICATE REQUEST-----
.
This corresponds to PEM_read_bio_X509_REQ
.
sourcepub fn from_der(der: &[u8]) -> Result<X509Req, ErrorStack>
pub fn from_der(der: &[u8]) -> Result<X509Req, ErrorStack>
Deserializes a DER-encoded PKCS#10 certificate request structure.
This corresponds to d2i_X509_REQ
.
Methods from Deref<Target = X509ReqRef>
sourcepub fn to_pem(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the certificate request to a PEM-encoded PKCS#10 structure.
The output will have a header of -----BEGIN CERTIFICATE REQUEST-----
.
This corresponds to PEM_write_bio_X509_REQ
.
sourcepub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the certificate request to a DER-encoded PKCS#10 structure.
This corresponds to i2d_X509_REQ
.
sourcepub fn version(&self) -> i32
pub fn version(&self) -> i32
Returns the numerical value of the version field of the certificate request.
This corresponds to X509_REQ_get_version
sourcepub fn subject_name(&self) -> &X509NameRef
pub fn subject_name(&self) -> &X509NameRef
Returns the subject name of the certificate request.
This corresponds to X509_REQ_get_subject_name
sourcepub fn public_key(&self) -> Result<PKey<Public>, ErrorStack>
pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack>
Returns the public key of the certificate request.
This corresponds to [`X509_REQ_get_pubkey“]
sourcepub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack> where
T: HasPublic,
pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack> where
T: HasPublic,
Check if the certificate request is signed using the given public key.
Returns true
if verification succeeds.
This corresponds to [`X509_REQ_verify“].
sourcepub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack>
pub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack>
Returns the extensions of the certificate request.
This corresponds to [`X509_REQ_get_extensions“]
Trait Implementations
sourceimpl AsRef<X509ReqRef> for X509Req
impl AsRef<X509ReqRef> for X509Req
sourcefn as_ref(&self) -> &X509ReqRef
fn as_ref(&self) -> &X509ReqRef
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<X509ReqRef> for X509Req
impl Borrow<X509ReqRef> for X509Req
sourcefn borrow(&self) -> &X509ReqRef
fn borrow(&self) -> &X509ReqRef
Immutably borrows from an owned value. Read more
sourceimpl Deref for X509Req
impl Deref for X509Req
type Target = X509ReqRef
type Target = X509ReqRef
The resulting type after dereferencing.
sourcefn deref(&self) -> &X509ReqRef
fn deref(&self) -> &X509ReqRef
Dereferences the value.
sourceimpl DerefMut for X509Req
impl DerefMut for X509Req
sourcefn deref_mut(&mut self) -> &mut X509ReqRef
fn deref_mut(&mut self) -> &mut X509ReqRef
Mutably dereferences the value.
sourceimpl ForeignType for X509Req
impl ForeignType for X509Req
impl Send for X509Req
impl Sync for X509Req
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more