Trait fog_crypto::lock::LockInterface[][src]

pub trait LockInterface {
    fn id(&self) -> &LockId;
fn decrypt_lock_key(
        &self,
        lockbox: &LockLockboxRef
    ) -> Result<LockKey, CryptoError>;
fn decrypt_identity_key(
        &self,
        lockbox: &IdentityLockboxRef
    ) -> Result<IdentityKey, CryptoError>;
fn decrypt_stream_key(
        &self,
        lockbox: &StreamLockboxRef
    ) -> Result<StreamKey, CryptoError>;
fn decrypt_data(
        &self,
        lockbox: &DataLockboxRef
    ) -> Result<Vec<u8>, CryptoError>;
fn self_export_lock(
        &self,
        csprng: &mut dyn CryptoSrc,
        receive_lock: &LockId
    ) -> Option<LockLockbox>;
fn self_export_stream(
        &self,
        csprng: &mut dyn CryptoSrc,
        receive_stream: &StreamKey
    ) -> Option<LockLockbox>; }

A decryption interface, implemented by anything that can hold a private cryptographic decryption key.

An implementor must handle all supported Diffie-Hellman algorithms and symmetric-key encryption algorithms.

Required methods

fn id(&self) -> &LockId[src]

Get the corresponding LockId for the private key.

fn decrypt_lock_key(
    &self,
    lockbox: &LockLockboxRef
) -> Result<LockKey, CryptoError>
[src]

Decrypt an exported LockKey.

fn decrypt_identity_key(
    &self,
    lockbox: &IdentityLockboxRef
) -> Result<IdentityKey, CryptoError>
[src]

Decrypt an exported IdentityKey.

fn decrypt_stream_key(
    &self,
    lockbox: &StreamLockboxRef
) -> Result<StreamKey, CryptoError>
[src]

Decrypt an exported StreamKey.

fn decrypt_data(&self, lockbox: &DataLockboxRef) -> Result<Vec<u8>, CryptoError>[src]

Decrypt encrypted data.

fn self_export_lock(
    &self,
    csprng: &mut dyn CryptoSrc,
    receive_lock: &LockId
) -> Option<LockLockbox>
[src]

Export the decryption key in a LockLockbox, with receive_lock as the recipient. If the key cannot be exported, this should return None.

fn self_export_stream(
    &self,
    csprng: &mut dyn CryptoSrc,
    receive_stream: &StreamKey
) -> Option<LockLockbox>
[src]

Export the decryption key in a LockLockbox, with receive_stream as the recipient. If the key cannot be exported, this should return None.

Loading content...

Implementors

impl LockInterface for ContainedLockKey[src]

Loading content...