Trait trussed::client::CryptoClient
source · [−]pub trait CryptoClient: PollClient {
Show 20 methods
fn agree(
&mut self,
mechanism: Mechanism,
private_key: KeyId,
public_key: KeyId,
attributes: StorageAttributes
) -> ClientResult<'_, Agree, Self> { ... }
fn attest(
&mut self,
signing_mechanism: Mechanism,
private_key: KeyId
) -> ClientResult<'_, Attest, Self> { ... }
fn decrypt<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: &[u8],
tag: &[u8]
) -> ClientResult<'c, Decrypt, Self> { ... }
fn delete(&mut self, key: KeyId) -> ClientResult<'_, Delete, Self> { ... }
fn delete_all(
&mut self,
location: Location
) -> ClientResult<'_, DeleteAllKeys, Self> { ... }
fn derive_key(
&mut self,
mechanism: Mechanism,
base_key: KeyId,
additional_data: Option<MediumData>,
attributes: StorageAttributes
) -> ClientResult<'_, DeriveKey, Self> { ... }
fn deserialize_key<'c>(
&'c mut self,
mechanism: Mechanism,
serialized_key: &[u8],
format: KeySerialization,
attributes: StorageAttributes
) -> ClientResult<'c, DeserializeKey, Self> { ... }
fn encrypt<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: Option<ShortData>
) -> ClientResult<'c, Encrypt, Self> { ... }
fn exists(
&mut self,
mechanism: Mechanism,
key: KeyId
) -> ClientResult<'_, Exists, Self> { ... }
fn generate_key(
&mut self,
mechanism: Mechanism,
attributes: StorageAttributes
) -> ClientResult<'_, GenerateKey, Self> { ... }
fn generate_secret_key(
&mut self,
size: usize,
persistence: Location
) -> ClientResult<'_, GenerateSecretKey, Self> { ... }
fn hash(
&mut self,
mechanism: Mechanism,
message: Message
) -> ClientResult<'_, Hash, Self> { ... }
fn random_bytes(
&mut self,
count: usize
) -> ClientResult<'_, RandomBytes, Self> { ... }
fn serialize_key(
&mut self,
mechanism: Mechanism,
key: KeyId,
format: KeySerialization
) -> ClientResult<'_, SerializeKey, Self> { ... }
fn sign<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
data: &[u8],
format: SignatureSerialization
) -> ClientResult<'c, Sign, Self> { ... }
fn verify<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
signature: &[u8],
format: SignatureSerialization
) -> ClientResult<'c, Verify, Self> { ... }
fn unsafe_inject_key(
&mut self,
mechanism: Mechanism,
raw_key: &[u8],
persistence: Location
) -> ClientResult<'_, UnsafeInjectKey, Self> { ... }
fn unsafe_inject_shared_key(
&mut self,
raw_key: &[u8],
location: Location
) -> ClientResult<'_, UnsafeInjectSharedKey, Self> { ... }
fn unwrap_key<'c>(
&'c mut self,
mechanism: Mechanism,
wrapping_key: KeyId,
wrapped_key: Message,
associated_data: &[u8],
attributes: StorageAttributes
) -> ClientResult<'c, UnwrapKey, Self> { ... }
fn wrap_key(
&mut self,
mechanism: Mechanism,
wrapping_key: KeyId,
key: KeyId,
associated_data: &[u8]
) -> ClientResult<'_, WrapKey, Self> { ... }
}
Expand description
Trussed Client interface that Trussed apps can rely on.
Provided methods
fn agree(
&mut self,
mechanism: Mechanism,
private_key: KeyId,
public_key: KeyId,
attributes: StorageAttributes
) -> ClientResult<'_, Agree, Self>
fn attest(
&mut self,
signing_mechanism: Mechanism,
private_key: KeyId
) -> ClientResult<'_, Attest, Self>
fn decrypt<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: &[u8],
tag: &[u8]
) -> ClientResult<'c, Decrypt, Self>
fn delete(&mut self, key: KeyId) -> ClientResult<'_, Delete, Self>
fn delete_all(
&mut self,
location: Location
) -> ClientResult<'_, DeleteAllKeys, Self>
fn delete_all(
&mut self,
location: Location
) -> ClientResult<'_, DeleteAllKeys, Self>
Skips deleting read-only / manufacture keys (currently, “low ID”).
fn derive_key(
&mut self,
mechanism: Mechanism,
base_key: KeyId,
additional_data: Option<MediumData>,
attributes: StorageAttributes
) -> ClientResult<'_, DeriveKey, Self>
fn deserialize_key<'c>(
&'c mut self,
mechanism: Mechanism,
serialized_key: &[u8],
format: KeySerialization,
attributes: StorageAttributes
) -> ClientResult<'c, DeserializeKey, Self>
fn encrypt<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: Option<ShortData>
) -> ClientResult<'c, Encrypt, Self>
fn generate_key(
&mut self,
mechanism: Mechanism,
attributes: StorageAttributes
) -> ClientResult<'_, GenerateKey, Self>
fn generate_secret_key(
&mut self,
size: usize,
persistence: Location
) -> ClientResult<'_, GenerateSecretKey, Self>
fn random_bytes(&mut self, count: usize) -> ClientResult<'_, RandomBytes, Self>
fn serialize_key(
&mut self,
mechanism: Mechanism,
key: KeyId,
format: KeySerialization
) -> ClientResult<'_, SerializeKey, Self>
fn sign<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
data: &[u8],
format: SignatureSerialization
) -> ClientResult<'c, Sign, Self>
fn verify<'c>(
&'c mut self,
mechanism: Mechanism,
key: KeyId,
message: &[u8],
signature: &[u8],
format: SignatureSerialization
) -> ClientResult<'c, Verify, Self>
fn unsafe_inject_key(
&mut self,
mechanism: Mechanism,
raw_key: &[u8],
persistence: Location
) -> ClientResult<'_, UnsafeInjectKey, Self>
fn unsafe_inject_key(
&mut self,
mechanism: Mechanism,
raw_key: &[u8],
persistence: Location
) -> ClientResult<'_, UnsafeInjectKey, Self>
👎 Deprecated
This mechanism-specific key injection is deprecated in favor of the general injection mechanism for symmetric keys of unknown quality, i.e., “shared” keys, of trussed::key::Kind::Shared.
The implementations have been removed, so replace your usage with the
methoed unsafe_inject_shared_key
.