[][src]Struct saltlick::SecretKey

pub struct SecretKey { /* fields omitted */ }

Wrapper over libsodium-provided secret key type.

Implementations

impl SecretKey[src]

pub fn from_raw_curve25519(bytes: &[u8]) -> Result<SecretKey, SaltlickError>[src]

Load secret key from raw Curve25519 bytes.

This must be 32 bytes long. It corresponds to the key type used by libsodium 1.x.

pub fn from_pem(pem: &str) -> Result<SecretKey, SaltlickError>[src]

Load secret key from PEM file.

pub fn to_pem(&self) -> String[src]

Export secret key as PEM-encoded string.

pub fn from_file(
    path: impl AsRef<Path>
) -> Result<SecretKey, SaltlickKeyIoError>
[src]

Load a secret key in PEM format from path.

pub fn to_file(&self, path: impl AsRef<Path>) -> Result<(), SaltlickKeyIoError>[src]

Write a secret key to path in PEM format.

Note that this uses create_new and will return the io::Error AlreadyExists if there is already a file at the destination.

Trait Implementations

impl Clone for SecretKey[src]

impl Debug for SecretKey[src]

impl Eq for SecretKey[src]

impl FromASN1 for SecretKey[src]

impl PartialEq<SecretKey> for SecretKey[src]

impl StructuralEq for SecretKey[src]

impl StructuralPartialEq for SecretKey[src]

impl ToASN1 for SecretKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromASN1WithBody for T where
    T: FromASN1
[src]

type Error = <T as FromASN1>::Error

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.