[−][src]Struct saltlick::SecretKey
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]
path: impl AsRef<Path>
) -> Result<SecretKey, SaltlickKeyIoError>
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]
type Error = SaltlickError
fn from_asn1(v: &[ASN1Block]) -> Result<(Self, &[ASN1Block]), Self::Error>
[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
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> FromASN1WithBody for T where
T: FromASN1,
[src]
T: FromASN1,
type Error = <T as FromASN1>::Error
fn from_asn1_with_body(
v: &'a [ASN1Block],
_b: &[u8]
) -> Result<(T, &'a [ASN1Block]), <T as FromASN1>::Error>
[src]
v: &'a [ASN1Block],
_b: &[u8]
) -> Result<(T, &'a [ASN1Block]), <T as FromASN1>::Error>
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,