Trait SparkSignerEcies

Source
pub trait SparkSignerEcies {
    // Required methods
    fn encrypt_secret_key_with_ecies<T, U>(
        &self,
        receiver_public_key: T,
        pubkey_for_sk_to_encrypt: U,
    ) -> Result<Vec<u8>, SparkSdkError>
       where T: AsRef<[u8]>,
             U: AsRef<[u8]>;
    fn decrypt_secret_key_with_ecies<T>(
        &self,
        ciphertext: T,
    ) -> Result<Vec<u8>, SparkSdkError>
       where T: AsRef<[u8]>;
}

Required Methods§

Source

fn encrypt_secret_key_with_ecies<T, U>( &self, receiver_public_key: T, pubkey_for_sk_to_encrypt: U, ) -> Result<Vec<u8>, SparkSdkError>
where T: AsRef<[u8]>, U: AsRef<[u8]>,

Encrypts a secret key using the ECIES algorithm.

§Arguments
  • receiver_public_key - The public key to encrypt the secret key with (implements AsRef<[u8]>)
  • plaintext - The plaintext to encrypt (implements AsRef<[u8]>)
§Returns

The encrypted secret key in a 64 bytes array of Vec<u8>.

Source

fn decrypt_secret_key_with_ecies<T>( &self, ciphertext: T, ) -> Result<Vec<u8>, SparkSdkError>
where T: AsRef<[u8]>,

Decrypts a secret key using the ECIES algorithm.

§Arguments
  • ciphertext - The ciphertext to decrypt (implements AsRef<[u8]>)
§Returns

The decrypted secret key in a 32 bytes array of Vec<u8>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§