# Struct ring::aead::OpeningKey [−] [src]

    pub struct OpeningKey { /* fields omitted */ }

A key for authenticating and decrypting (“opening”) AEAD-protected data.

C analog: `EVP_AEAD_CTX` with direction `evp_aead_open`

Go analog: [`crypto.cipher.AEAD`]

## Methods

### `impl OpeningKey`
[src]

#### `fn new(
algorithm: &'static Algorithm,
key_bytes: &[u8]
) -> Result<OpeningKey, Unspecified>`

Create a new opening key.

`key_bytes` must be exactly `algorithm.key_len` bytes long.

C analogs: `EVP_AEAD_CTX_init_with_direction` with direction `evp_aead_open`, `EVP_AEAD_CTX_init`.

Go analog: `crypto.aes.NewCipher` + `crypto.cipher.NewGCM`

#### `fn algorithm(&self) -> &'static Algorithm`

The key's AEAD algorithm.

C analog: `EVP_AEAD_CTX.aead`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)