# Struct openssl::x509::extension::KeyUsage [−] [src]

    pub struct KeyUsage { /* fields omitted */ }

An extension consisting of a list of names of the permitted key usages.

## Implementations

### `impl KeyUsage` [src]

#### `pub fn new() -> KeyUsage` [src]

Construct a new `KeyUsage` extension.

#### `pub fn critical(&mut self) -> &mut KeyUsage` [src]

Sets the `critical` flag to `true`. The extension will be critical.

#### `pub fn digital_signature(&mut self) -> &mut KeyUsage` [src]

Sets the `digitalSignature` flag to `true`.

#### `pub fn non_repudiation(&mut self) -> &mut KeyUsage` [src]

Sets the `nonRepudiation` flag to `true`.

#### `pub fn key_encipherment(&mut self) -> &mut KeyUsage` [src]

Sets the `keyEncipherment` flag to `true`.

#### `pub fn data_encipherment(&mut self) -> &mut KeyUsage` [src]

Sets the `dataEncipherment` flag to `true`.

#### `pub fn key_agreement(&mut self) -> &mut KeyUsage` [src]

Sets the `keyAgreement` flag to `true`.

#### `pub fn key_cert_sign(&mut self) -> &mut KeyUsage` [src]

Sets the `keyCertSign` flag to `true`.

#### `pub fn crl_sign(&mut self) -> &mut KeyUsage` [src]

Sets the `cRLSign` flag to `true`.

#### `pub fn encipher_only(&mut self) -> &mut KeyUsage` [src]

Sets the `encipherOnly` flag to `true`.

#### `pub fn decipher_only(&mut self) -> &mut KeyUsage` [src]

Sets the `decipherOnly` flag to `true`.

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

Return the `KeyUsage` extension as an `X509Extension`.

## Trait Implementations

### `impl Default for KeyUsage` [src]

#### `fn default() -> KeyUsage` [src]

Returns the “default value” for a type. Read more

## Auto Trait Implementations

### `impl RefUnwindSafe for KeyUsage`

### `impl Send for KeyUsage`

### `impl Sync for KeyUsage`

### `impl Unpin for KeyUsage`

### `impl UnwindSafe for KeyUsage`

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