[][src]Trait lockbook_core::service::crypto_service::PubKeyCryptoService

pub trait PubKeyCryptoService {
    fn generate_key() -> Result<RSAPrivateKey, Error>;
fn encrypt(
        public_key: &RSAPublicKey,
        decrypted: &DecryptedValue
    ) -> Result<EncryptedValue, Error>;
fn sign(
        private_key: &RSAPrivateKey,
        to_sign: String
    ) -> Result<SignedValue, Error>;
fn verify(
        public_key: &RSAPublicKey,
        signed_value: &SignedValue
    ) -> Result<(), SignatureVerificationFailed>;
fn decrypt(
        private_key: &RSAPrivateKey,
        encrypted: &EncryptedValue
    ) -> Result<DecryptedValue, DecryptionFailed>; }

Required methods

fn generate_key() -> Result<RSAPrivateKey, Error>

fn encrypt(
    public_key: &RSAPublicKey,
    decrypted: &DecryptedValue
) -> Result<EncryptedValue, Error>

fn sign(
    private_key: &RSAPrivateKey,
    to_sign: String
) -> Result<SignedValue, Error>

fn verify(
    public_key: &RSAPublicKey,
    signed_value: &SignedValue
) -> Result<(), SignatureVerificationFailed>

fn decrypt(
    private_key: &RSAPrivateKey,
    encrypted: &EncryptedValue
) -> Result<DecryptedValue, DecryptionFailed>

Loading content...

Implementors

impl PubKeyCryptoService for RsaImpl[src]

Loading content...