# IVncPasswordChallenge

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-headless-vnc/remote_viewing/vnc/trait-ivncpasswordchallenge/

**trait** · [`ferroui-headless-vnc`](/docs/0.5.0/api/ferroui-headless-vnc/) · v0.5.0

```rust
trait IVncPasswordChallenge: Send + Sync
```

A common interface for types which implement the VNC password challenge
protocol.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Headless/FerroUI.Headless.Vnc/remote_viewing/vnc/i_vnc_password_challenge.rs#L6)

## Members

- [`generate_challenge`](#function-generate_challenge)
- [`get_challenge_response_chars`](#function-get_challenge_response_chars)
- [`get_challenge_response`](#function-get_challenge_response)

<a id="function-generate_challenge"></a>

### generate_challenge

```rust
fn generate_challenge(self: &Self) -> Vec<u8>
```

Generates a 16-byte challenge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Headless/FerroUI.Headless.Vnc/remote_viewing/vnc/i_vnc_password_challenge.rs#L8)

<a id="function-get_challenge_response_chars"></a>

### get_challenge_response_chars

```rust
fn get_challenge_response_chars(self: &Self, challenge: &[u8], password: &[char], response: &mut [u8])
```

Calculates a `response` for a password `challenge`, using the
characters of a `password`.
## Panics
When the challenge or the response is not 16 bytes long
(`ArgumentOutOfRangeException`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Headless/FerroUI.Headless.Vnc/remote_viewing/vnc/i_vnc_password_challenge.rs#L16)

<a id="function-get_challenge_response"></a>

### get_challenge_response

```rust
fn get_challenge_response(self: &Self, challenge: &[u8], password: &[u8], response: &mut [u8])
```

Calculates a `response` for a password `challenge`, using the bytes
of a `password`.
## Panics
When the challenge or the response is not 16 bytes long
(`ArgumentOutOfRangeException`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Headless/FerroUI.Headless.Vnc/remote_viewing/vnc/i_vnc_password_challenge.rs#L29)

## Trait implementations

- [`IVncPasswordChallenge`](/docs/0.5.0/api/ferroui-headless-vnc/remote_viewing/vnc/trait-ivncpasswordchallenge/)

## Availability

Extracted for `x86_64-unknown-linux-gnu`, `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
