# Struct crypto::voice::FrameSealer

> Seals this participant's frames under one base key and KID. The counter starts at zero and never repeats; after `FRAMES_PER_KEY` frames it refuses and the sender rekeys.

`zaun_community_protocol::crypto::voice::FrameSealer` · Struct

```rust
pub struct FrameSealer { … }
```

Seals this participant's frames under one base key and KID. The counter starts at zero and
never repeats; after `FRAMES_PER_KEY` frames it refuses and the sender rekeys.

## Methods

### `new`

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

A sealer for `base` under `kid`. A base key is used by one sender only.

### `kid`

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

The KID frames are sealed under.

### `seal`

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

`header ‖ AES-256-GCM(frame)`, authenticating the header and `metadata`.

# Errors
`VoiceError::Exhausted` after `FRAMES_PER_KEY` frames.

## Trait implementations

`Debug`

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