# Struct crypto::voice::VoiceIdentity

> A voice session's X-Wing key pair. The secret is the 32-byte X-Wing seed, zeroized on drop and never printed. It lives only as long as the voice session; it is never stored.

`zaun_community_protocol::crypto::voice::VoiceIdentity` · Struct

```rust
pub struct VoiceIdentity { … }
```

A voice session's X-Wing key pair. The secret is the 32-byte X-Wing seed, zeroized on drop
and never printed. It lives only as long as the voice session; it is never stored.

## Methods

### `generate`

```rust
pub fn generate() -> Result<Self, VoiceError>
```

A fresh key pair from the OS CSPRNG.

# Errors
`VoiceError::Rng` when the CSPRNG fails.

### `from_seed`

```rust
pub fn from_seed(seed: &[u8; 32]) -> Result<Self, VoiceError>
```

The key pair of an X-Wing seed (the X-Wing decapsulation key, draft the protocol). Tests and
known-answer vectors only; real sessions use `Self::generate`.

# Errors
`VoiceError::PublicKey` if the derived public key does not re-parse (never expected).

### `public_key`

```rust
pub const fn public_key(&self) -> &VoicePublicKey
```

The public half, published in the key package.

## Trait implementations

`Debug`

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