Struct safe_crypto::SecretId [−][src]
pub struct SecretId { /* fields omitted */ }
Secret counterpart of the public identity, consisting of a secret signing key and a secret encryption key.
Methods
impl SecretId
[src]
impl SecretId
pub fn new() -> SecretId
[src]
pub fn new() -> SecretId
Generates a pair of secret and public key sets.
pub fn public_id(&self) -> &PublicId
[src]
pub fn public_id(&self) -> &PublicId
Returns the public part of the secret key set.
pub fn decrypt_anonymous<T>(
&self,
ciphertext: &[u8]
) -> Result<T, EncryptionError> where
T: Serialize + DeserializeOwned,
[src]
pub fn decrypt_anonymous<T>(
&self,
ciphertext: &[u8]
) -> Result<T, EncryptionError> where
T: Serialize + DeserializeOwned,
Decrypts serialised ciphertext
encrypted using anonymous encryption.
With anonymous encryption we won't be able to verify the sender and tell who sent the ciphertext.
Returns deserialised type T
in case of success.
Can return EncryptionError
in case of a deserialisation error, if the ciphertext is
not valid, or if it can not be decrypted.
pub fn decrypt_anonymous_bytes(
&self,
ciphertext: &[u8]
) -> Result<Vec<u8>, EncryptionError>
[src]
pub fn decrypt_anonymous_bytes(
&self,
ciphertext: &[u8]
) -> Result<Vec<u8>, EncryptionError>
Decrypts bytestring ciphertext
encrypted using anonymous encryption.
With anonymous encryption we won't be able to verify the sender and tell who sent the ciphertext.
Returns plaintext in case of success.
Can return EncryptionError
if the ciphertext is not valid or if it can not be decrypted.
pub fn sign_detached(&self, data: &[u8]) -> Signature
[src]
pub fn sign_detached(&self, data: &[u8]) -> Signature
Produces the detached signature from the data
.
Afterwards the returned Signature
can be used to verify the authenticity of data
.
Computes a shared secret from our secret key and the recipient's public key.
Trait Implementations
impl Debug for SecretId
[src]
impl Debug for SecretId
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for SecretId
[src]
impl PartialEq for SecretId
fn eq(&self, other: &SecretId) -> bool
[src]
fn eq(&self, other: &SecretId) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SecretId) -> bool
[src]
fn ne(&self, other: &SecretId) -> bool
This method tests for !=
.
impl Eq for SecretId
[src]
impl Eq for SecretId
impl Clone for SecretId
[src]
impl Clone for SecretId
fn clone(&self) -> SecretId
[src]
fn clone(&self) -> SecretId
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for SecretId
[src]
impl Default for SecretId