# Struct crypto::voice::FrameOpener

> Opens one sender's frames for one KID, rejecting replays.

`zaun_community_protocol::crypto::voice::FrameOpener` · Struct

```rust
pub struct FrameOpener { … }
```

Opens one sender's frames for one KID, rejecting replays.

## Methods

### `new`

```rust
pub fn new(base: &SenderKey, kid: u64) -> Self
```

An opener for `base` under `kid` (decryption only).

### `kid`

```rust
pub const fn kid(&self) -> u64
```

The KID this opener accepts.

### `open`

```rust
pub fn open(&mut self, metadata: &[u8], frame: &[u8]) -> Result<Vec<u8>, VoiceError>
```

Opens a sealed frame. The counter is recorded only once the frame authenticates.

# Errors
`VoiceError::Header`, `VoiceError::UnknownKid` for another KID,
`VoiceError::Replay` or `VoiceError::Open`.

## Trait implementations

`Debug`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/crypto/voice/sframe/struct.FrameOpener.html)
