SecretHandle

Structin secret_storefastly 0.13.1View source
pub struct SecretHandle { /* private fields */ }

A low-level interface to a secret.

Methods here are typically exposed as the APIs on crate::secret_store::Secret and should not be needed directly.

Constants

INVALID

Selfread-onlyView source

An invalid secret handle.

Methods

is_invalid

View source
fn is_invalid(&self) -> bool

Return true if the crate::secret_store::Secret handle is invalid.

Parameters

self: &Self

Returns

bool
fn new(secret: &[u8]) -> Result<SecretHandle, FastlyStatus>

Create a new "secret" from the given memory. This is not the suggested way to create Secrets; instead, we suggest using SecretStore::get.

This method can be used for data that should be secret, but is being obtained by some other means than the secret store. New "secrets" created this way use plaintext only, and live in the session's memory unencrypted for much longer than secrets generated by SecretStore::get. They should thus only be used in situations in which an API requires a Secret, but you cannot (for whatever reason) use a SecretStore to store them.

Parameters

secret: &[u8]

Returns

plaintext

View source
fn plaintext(&self) -> Result<Bytes, DecryptError>

Return the plaintext value of this secret.

Parameters

self: &Self

Returns

Trait implementations

impl Debug for SecretHandle

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Parameters

self: &Self
f: &mut $crate::fmt::Formatter

Returns

$crate::fmt::Result

impl Hash for SecretHandle

fn hash<__H: Hasher>(&self, state: &mut __H)

Parameters

self: &Self
state: &mut __H

impl PartialEq for SecretHandle

fn eq(&self, other: &Self) -> bool

Parameters

self: &Self
other: &Self

Returns

bool

Auto trait implementations

Blanket implementations