# Struct openssl::x509::X509Req [−] [src]

    pub struct X509Req(_);

An `X509` certificate request.

## Implementations

### `impl X509Req` [src]

#### `pub fn builder() -> Result<X509ReqBuilder, ErrorStack>` [src]

A builder for `X509Req`.

#### `pub fn from_pem(pem: &[u8]) -> Result<X509Req, ErrorStack>` [src]

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`.

#### `pub fn from_der(der: &[u8]) -> Result<X509Req, ErrorStack>` [src]

Deserializes a DER-encoded PKCS#10 certificate request structure.

This corresponds to `d2i_X509_REQ`.

## Methods from Deref<Target = X509ReqRef>

#### `pub fn to_pem(&self) -> Result<Vec<u8>, ErrorStack>` [src]

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`.

#### `pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>` [src]

Serializes the certificate request to a DER-encoded PKCS#10 structure.

This corresponds to `i2d_X509_REQ`.

#### `pub fn version(&self) -> i32` [src]

Returns the numerical value of the version field of the certificate request.

This corresponds to `X509_REQ_get_version`

#### `pub fn subject_name(&self) -> &X509NameRef` [src]

Returns the subject name of the certificate request.

This corresponds to `X509_REQ_get_subject_name`

#### `pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack>` [src]

Returns the public key of the certificate request.

This corresponds to [`X509_REQ_get_pubkey“]

#### `pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack> where
T: HasPublic,` [src]

Check if the certificate request is signed using the given public key.

Returns `true` if verification succeeds.

This corresponds to [`X509_REQ_verify“].

#### `pub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack>` [src]

Returns the extensions of the certificate request.

This corresponds to [`X509_REQ_get_extensions“]

## Trait Implementations

### `impl AsRef<X509ReqRef> for X509Req` [src]

#### `fn as_ref(&self) -> &X509ReqRef` [src]

Performs the conversion.

### `impl Borrow<X509ReqRef> for X509Req` [src]

#### `fn borrow(&self) -> &X509ReqRef` [src]

Immutably borrows from an owned value. Read more

### `impl Deref for X509Req` [src]

#### `type Target = X509ReqRef`

The resulting type after dereferencing.

#### `fn deref(&self) -> &X509ReqRef` [src]

Dereferences the value.

### `impl DerefMut for X509Req` [src]

#### `fn deref_mut(&mut self) -> &mut X509ReqRef` [src]

Mutably dereferences the value.

### `impl Drop for X509Req` [src]

#### `fn drop(&mut self)` [src]

Executes the destructor for this type. Read more

### `impl ForeignType for X509Req` [src]

#### `type CType = X509_REQ`

The raw C type.

#### `type Ref = X509ReqRef`

The type representing a reference to this type.

#### `unsafe fn from_ptr(ptr: *mut X509_REQ) -> X509Req` [src]

Constructs an instance of this type from its raw type.

#### `fn as_ptr(&self) -> *mut X509_REQ` [src]

Returns a raw pointer to the wrapped value.

### `impl Send for X509Req` [src]

### `impl Sync for X509Req` [src]

## Auto Trait Implementations

### `impl RefUnwindSafe for X509Req`

### `impl Unpin for X509Req`

### `impl UnwindSafe for X509Req`

## Blanket Implementations

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

#### `pub fn type_id(&self) -> TypeId` [src]

Gets the `TypeId` of `self`. Read more

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

#### `pub fn borrow(&self) -> &T` [src]

Immutably borrows from an owned value. Read more

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

#### `pub fn borrow_mut(&mut self) -> &mut T` [src]

Mutably borrows from an owned value. Read more

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

#### `pub fn from(t: T) -> T` [src]

Performs the conversion.

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

#### `pub fn into(self) -> U` [src]

Performs the conversion.

### `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.

#### `pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>` [src]

Performs the conversion.

### `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.

#### `pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>` [src]

Performs the conversion.