# Struct crypto::voice::VoicePublicKey

> An X-Wing encapsulation key (ML-KEM-768 ‖ X25519, 1 216 bytes), validated on parse.

`zaun_community_protocol::crypto::voice::VoicePublicKey` · Struct

```rust
pub struct VoicePublicKey { … }
```

An X-Wing encapsulation key (ML-KEM-768 ‖ X25519, 1 216 bytes), validated on parse.

## Methods

### `from_bytes`

```rust
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VoiceError>
```

Parses and validates the encoding (the ML-KEM-768 part must be canonical).

# Errors
`VoiceError::PublicKey` for an invalid key, `VoiceError::Length` for a wrong length.

### `as_bytes`

```rust
pub const fn as_bytes(&self) -> &[u8; 1216]
```

The 1 216-byte encoding.

## Trait implementations

`Clone`, `Debug`, `Eq`, `PartialEq`, `StructuralPartialEq`

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