pub struct X509ReqRef(/* private fields */);
Expand description
Reference to X509Req
.
Implementations§
Source§impl X509ReqRef
impl 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 to_text(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_text(&self) -> Result<Vec<u8>, ErrorStack>
Converts the request to human readable text.
This corresponds to X509_Req_print
.
Sourcepub fn digest(
&self,
hash_type: MessageDigest,
) -> Result<DigestBytes, ErrorStack>
pub fn digest( &self, hash_type: MessageDigest, ) -> Result<DigestBytes, ErrorStack>
Returns a digest of the DER representation of this ‘X509Req’.
This corresponds to X509_REQ_digest
.
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 x509_pubkey(&self) -> Result<&X509PubkeyRef, ErrorStack>
pub fn x509_pubkey(&self) -> Result<&X509PubkeyRef, ErrorStack>
Returns the X509Pubkey of the certificate request.
This corresponds to [`X509_REQ_get_X509_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
.