[][src]Enum cryptouri::secret_key::SecretKey

pub enum SecretKey {
    Aes128Gcm(Aes128GcmKey),
    Aes256Gcm(Aes256GcmKey),
    Ed25519(Ed25519SecretKey),
}

Secret key algorithms

Variants

Aes128Gcm(Aes128GcmKey)

AES-128 in Galois Counter Mode

Aes256Gcm(Aes256GcmKey)

AES-256 in Galois Counter Mode

Ed25519(Ed25519SecretKey)

Ed25519 private scalar

Methods

impl SecretKey[src]

pub fn new(alg: &str, slice: &[u8]) -> Result<Self, Error>[src]

Create a new SecretKey for the given algorithm

pub fn aes128gcm_key(&self) -> Option<&Aes128GcmKey>[src]

Return an Aes128GcmKey if the underlying secret key is AES-128-GCM

pub fn is_aes128gcm_key(&self) -> bool[src]

Is this SecretKey an AES-128-GCM secret key?

pub fn aes256gcm_key(&self) -> Option<&Aes256GcmKey>[src]

Return an Aes256GcmKey if the underlying secret key is AES-256-GCM

pub fn is_aes256gcm_key(&self) -> bool[src]

Is this SecretKey an AES-256-GCM secret key?

pub fn ed25519_key(&self) -> Option<&Ed25519SecretKey>[src]

Return an Ed25519SecretKey if the underlying secret key is Ed25519

pub fn is_ed25519_key(&self) -> bool[src]

Is this SecretKey an Ed25519 secret key?

Trait Implementations

impl Encodable for SecretKey[src]

fn to_uri_string(&self) -> String[src]

Serialize this SecretKey as a URI-encoded String

fn to_dasherized_string(&self) -> String[src]

Serialize this SecretKey as a "dasherized" String

Auto Trait Implementations

impl Send for SecretKey

impl Sync for SecretKey

Blanket Implementations

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

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

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self