Struct trussed::client::ClientImplementation
source · [−]pub struct ClientImplementation<S> { /* private fields */ }
Expand description
The client implementation client applications actually receive.
Implementations
sourceimpl<S> ClientImplementation<S> where
S: Syscall,
impl<S> ClientImplementation<S> where
S: Syscall,
pub fn new(interchange: Requester<TrussedInterchange>, syscall: S) -> Self
Trait Implementations
sourceimpl<S: Syscall> Aes256Cbc for ClientImplementation<S>
impl<S: Syscall> Aes256Cbc for ClientImplementation<S>
fn decrypt_aes256cbc<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Decrypt, Self>
fn wrap_key_aes256cbc(
&mut self,
wrapping_key: KeyId,
key: KeyId
) -> ClientResult<'_, WrapKey, Self>
sourceimpl<S: Syscall> CertificateClient for ClientImplementation<S>
impl<S: Syscall> CertificateClient for ClientImplementation<S>
fn delete_certificate(
&mut self,
id: CertId
) -> ClientResult<'_, DeleteCertificate, Self>
fn read_certificate(
&mut self,
id: CertId
) -> ClientResult<'_, ReadCertificate, Self>
sourcefn write_certificate(
&mut self,
location: Location,
der: &[u8]
) -> ClientResult<'_, WriteCertificate, Self>
fn write_certificate(
&mut self,
location: Location,
der: &[u8]
) -> ClientResult<'_, WriteCertificate, Self>
Currently, this writes the cert (assumed but not verified to be DER) as-is. It might make sense to add attributes (such as “deletable”). (On the other hand, the attn CA certs are not directly accessible to clients, and generated attn certs can be regenerated). Read more
sourceimpl<S: Syscall> Chacha8Poly1305 for ClientImplementation<S>
impl<S: Syscall> Chacha8Poly1305 for ClientImplementation<S>
fn decrypt_chacha8poly1305<'c>(
&'c mut self,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: &[u8],
tag: &[u8]
) -> ClientResult<'c, Decrypt, Self>
fn encrypt_chacha8poly1305<'c>(
&'c mut self,
key: KeyId,
message: &[u8],
associated_data: &[u8],
nonce: Option<&[u8; 12]>
) -> ClientResult<'c, Encrypt, Self>
fn generate_chacha8poly1305_key(
&mut self,
persistence: Location
) -> ClientResult<'_, GenerateKey, Self>
fn unwrap_key_chacha8poly1305<'c>(
&'c mut self,
wrapping_key: KeyId,
wrapped_key: &[u8],
associated_data: &[u8],
location: Location
) -> ClientResult<'c, UnwrapKey, Self>
fn wrap_key_chacha8poly1305<'c>(
&'c mut self,
wrapping_key: KeyId,
key: KeyId,
associated_data: &[u8]
) -> ClientResult<'c, WrapKey, Self>
sourceimpl<S: Syscall> CounterClient for ClientImplementation<S>
impl<S: Syscall> CounterClient for ClientImplementation<S>
fn create_counter(
&mut self,
location: Location
) -> ClientResult<'_, CreateCounter, Self>
fn increment_counter(
&mut self,
id: CounterId
) -> ClientResult<'_, IncrementCounter, Self>
sourceimpl<S: Syscall> CryptoClient for ClientImplementation<S>
impl<S: Syscall> CryptoClient for ClientImplementation<S>
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>
sourcefn 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 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>
sourcefn 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. Read more
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>
sourceimpl<S: Syscall> Ed255 for ClientImplementation<S>
impl<S: Syscall> Ed255 for ClientImplementation<S>
fn generate_ed255_private_key(
&mut self,
persistence: Location
) -> ClientResult<'_, GenerateKey, Self>
fn derive_ed255_public_key(
&mut self,
private_key: KeyId,
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn deserialize_ed255_key<'c>(
&'c mut self,
serialized_key: &[u8],
format: KeySerialization,
attributes: StorageAttributes
) -> ClientResult<'c, DeserializeKey, Self>
fn serialize_ed255_key(
&mut self,
key: KeyId,
format: KeySerialization
) -> ClientResult<'_, SerializeKey, Self>
fn sign_ed255<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Sign, Self>
fn verify_ed255<'c>(
&'c mut self,
key: KeyId,
message: &[u8],
signature: &[u8]
) -> ClientResult<'c, Verify, Self>
sourceimpl<S: Syscall> FilesystemClient for ClientImplementation<S>
impl<S: Syscall> FilesystemClient for ClientImplementation<S>
fn debug_dump_store(&mut self) -> ClientResult<'_, DebugDumpStore, Self>
fn read_dir_first(
&mut self,
location: Location,
dir: PathBuf,
not_before_filename: Option<PathBuf>
) -> ClientResult<'_, ReadDirFirst, Self>
fn read_dir_next(&mut self) -> ClientResult<'_, ReadDirNext, Self>
fn read_dir_files_first(
&mut self,
location: Location,
dir: PathBuf,
user_attribute: Option<UserAttribute>
) -> ClientResult<'_, ReadDirFilesFirst, Self>
fn read_dir_files_next(&mut self) -> ClientResult<'_, ReadDirFilesNext, Self>
fn remove_dir(
&mut self,
location: Location,
path: PathBuf
) -> ClientResult<'_, RemoveDirAll, Self>
fn remove_dir_all(
&mut self,
location: Location,
path: PathBuf
) -> ClientResult<'_, RemoveDirAll, Self>
fn remove_file(
&mut self,
location: Location,
path: PathBuf
) -> ClientResult<'_, RemoveFile, Self>
fn read_file(
&mut self,
location: Location,
path: PathBuf
) -> ClientResult<'_, ReadFile, Self>
fn locate_file(
&mut self,
location: Location,
dir: Option<PathBuf>,
filename: PathBuf
) -> ClientResult<'_, LocateFile, Self>
fn write_file(
&mut self,
location: Location,
path: PathBuf,
data: Message,
user_attribute: Option<UserAttribute>
) -> ClientResult<'_, WriteFile, Self>
sourceimpl<S: Syscall> HmacSha1 for ClientImplementation<S>
impl<S: Syscall> HmacSha1 for ClientImplementation<S>
fn hmacsha1_derive_key(
&mut self,
base_key: KeyId,
message: &[u8],
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn sign_hmacsha1<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Sign, Self>
sourceimpl<S: Syscall> HmacSha256 for ClientImplementation<S>
impl<S: Syscall> HmacSha256 for ClientImplementation<S>
fn hmacsha256_derive_key(
&mut self,
base_key: KeyId,
message: &[u8],
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn sign_hmacsha256<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Sign, Self>
sourceimpl<S: Syscall> ManagementClient for ClientImplementation<S>
impl<S: Syscall> ManagementClient for ClientImplementation<S>
fn reboot(&mut self, to: To) -> ClientResult<'_, Reboot, Self>
fn uptime(&mut self) -> ClientResult<'_, Uptime, Self>
sourceimpl<S: Syscall> P256 for ClientImplementation<S>
impl<S: Syscall> P256 for ClientImplementation<S>
fn generate_p256_private_key(
&mut self,
persistence: Location
) -> ClientResult<'_, GenerateKey, Self>
fn derive_p256_public_key(
&mut self,
private_key: KeyId,
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn deserialize_p256_key<'c>(
&'c mut self,
serialized_key: &[u8],
format: KeySerialization,
attributes: StorageAttributes
) -> ClientResult<'c, DeserializeKey, Self>
fn serialize_p256_key(
&mut self,
key: KeyId,
format: KeySerialization
) -> ClientResult<'_, SerializeKey, Self>
fn sign_p256<'c>(
&'c mut self,
key: KeyId,
message: &[u8],
format: SignatureSerialization
) -> ClientResult<'c, Sign, Self>
fn verify_p256<'c>(
&'c mut self,
key: KeyId,
message: &[u8],
signature: &[u8]
) -> ClientResult<'c, Verify, Self>
fn agree_p256(
&mut self,
private_key: KeyId,
public_key: KeyId,
persistence: Location
) -> ClientResult<'_, Agree, Self>
sourceimpl<S> PollClient for ClientImplementation<S> where
S: Syscall,
impl<S> PollClient for ClientImplementation<S> where
S: Syscall,
sourceimpl<S: Syscall> Sha256 for ClientImplementation<S>
impl<S: Syscall> Sha256 for ClientImplementation<S>
fn sha256_derive_key(
&mut self,
shared_key: KeyId,
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn hash_sha256<'c>(&'c mut self, message: &[u8]) -> ClientResult<'c, Hash, Self>
sourceimpl<S: Syscall> Tdes for ClientImplementation<S>
impl<S: Syscall> Tdes for ClientImplementation<S>
fn decrypt_tdes<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Decrypt, Self>
fn encrypt_tdes<'c>(
&'c mut self,
key: KeyId,
message: &[u8]
) -> ClientResult<'c, Encrypt, Self>
sourceimpl<S: Syscall> Totp for ClientImplementation<S>
impl<S: Syscall> Totp for ClientImplementation<S>
sourceimpl<S: Syscall> UiClient for ClientImplementation<S>
impl<S: Syscall> UiClient for ClientImplementation<S>
fn confirm_user_present(
&mut self,
timeout_milliseconds: u32
) -> ClientResult<'_, RequestUserConsent, Self>
fn wink(&mut self, duration: Duration) -> ClientResult<'_, Wink, Self>
sourceimpl<S: Syscall> X255 for ClientImplementation<S>
impl<S: Syscall> X255 for ClientImplementation<S>
fn generate_x255_secret_key(
&mut self,
persistence: Location
) -> ClientResult<'_, GenerateKey, Self>
fn derive_x255_public_key(
&mut self,
secret_key: KeyId,
persistence: Location
) -> ClientResult<'_, DeriveKey, Self>
fn agree_x255(
&mut self,
private_key: KeyId,
public_key: KeyId,
persistence: Location
) -> ClientResult<'_, Agree, Self>
impl<S: Syscall> Client for ClientImplementation<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for ClientImplementation<S> where
S: RefUnwindSafe,
impl<S> Send for ClientImplementation<S> where
S: Send,
impl<S> Sync for ClientImplementation<S> where
S: Sync,
impl<S> Unpin for ClientImplementation<S> where
S: Unpin,
impl<S> !UnwindSafe for ClientImplementation<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more