pub struct DidSecretsBundle {
pub did: String,
pub secrets: Vec<SecretEntry>,
}Expand description
A portable bundle of DID secrets for import/export.
Post-Phase-5 the canonical transport is [crate::sealed_transfer]
(SealedPayloadV1::DidSecrets). On-disk for local operator exports the
canonical form is pretty-printed JSON.
§Example — constructing secrets for DIDComm
Applications using affinidi_tdk can reconstruct Secret objects from the
entries in this bundle using Secret::from_multibase(), which handles all
key types (Ed25519, X25519, P-256) via their multicodec prefix:
ⓘ
use affinidi_tdk::secrets_resolver::secrets::Secret;
let bundle = client.fetch_did_secrets_bundle("my-context").await?;
for entry in &bundle.secrets {
let secret = Secret::from_multibase(
&entry.private_key_multibase,
Some(&entry.key_id),
)?;
resolver.insert(secret);
}Fields§
§did: StringThe DID these secrets belong to.
secrets: Vec<SecretEntry>Secret entries (one per verification method).
Trait Implementations§
Source§impl Clone for DidSecretsBundle
impl Clone for DidSecretsBundle
Source§fn clone(&self) -> DidSecretsBundle
fn clone(&self) -> DidSecretsBundle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DidSecretsBundle
impl Debug for DidSecretsBundle
Source§impl<'de> Deserialize<'de> for DidSecretsBundle
impl<'de> Deserialize<'de> for DidSecretsBundle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DidSecretsBundle
impl RefUnwindSafe for DidSecretsBundle
impl Send for DidSecretsBundle
impl Sync for DidSecretsBundle
impl Unpin for DidSecretsBundle
impl UnsafeUnpin for DidSecretsBundle
impl UnwindSafe for DidSecretsBundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more