Struct solidity_bindgen::SafeSecretKey[][src]

pub struct SafeSecretKey { /* fields omitted */ }
Expand description

Securely stores a secret key in memory that is zeroized on drop. Care is taken so that when this struct is constructed or moved that additional copies of the secret are not made in memory or disk. https://github.com/veorq/cryptocoding#clean-memory-of-secret-data

Unfortunately the SafeSecretKey is not magic, there are some things to be aware of when using it…

  • The memory used when constructing the secret key must also be zeroized, but this is left as an exercise to the caller.
  • If you mem::forget the SafeSecretKey or otherwise don’t drop it, the secret will not be zeroized.
  • When the caller lends out a reference to the SecretKey (available for example via Deref) it is the responsibility of the caller to not Clone the SecretKey or otherwise make a copy of it’s memory

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Executes the destructor for this type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Sign given message and include chain-id replay protection. Read more

Get public address that this key represents.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.