# Struct crypto::voice::KeyPackage

> A participant's voice key for one session in one voice channel.

`zaun_community_protocol::crypto::voice::KeyPackage` · Struct

```rust
pub struct KeyPackage { … }
```

A participant's voice key for one session in one voice channel.

## Fields

### `suite: u8`

2: the voice suite.

### `community_id: CommunityId`

3: the community.

### `channel_id: ChannelId`

4: the voice channel.

### `member_id: MemberId`

5: the participant; its member key signs.

### `voice_session: VoiceSessionId`

6: this participation.

### `kem_public: VoicePublicKey`

7: the X-Wing public key sender keys are wrapped to.

### `created_at: u64`

8: ms since the epoch.

## Methods

### `create`

```rust
pub fn create(member_key: &SecretKey, identity: &VoiceIdentity, community_id: CommunityId, channel_id: ChannelId, member_id: MemberId, voice_session: VoiceSessionId, created_at: u64) -> Result<SignedKeyPackage, VoiceError>
```

Makes and signs this participant's key package.

# Errors
`VoiceError::Signed` when signing fails.

### `verify`

```rust
pub fn verify(wire: &[u8], member_key: &PublicKey, expected: &PackageExpectation) -> Result<SignedKeyPackage, VoiceError>
```

Verifies a peer's key package from the wire under `member_key` (the roster's key for
`expected.member_id`), then checks the community, channel and member.

# Errors
`VoiceError::Length`, `VoiceError::Signed` (checked before decoding) or
`VoiceError::Mismatch`.

## Trait implementations

`Clone`, `Debug`, `Decode`, `Encode`, `Eq`, `PartialEq`, `SignedObject`, `StructuralPartialEq`

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