pub struct DidEnvelope {
pub id: String,
pub message_type: String,
pub from: Did,
pub to: Vec<Did>,
pub created_time: u64,
pub expires_time: u64,
pub body: DidMessageBody,
pub typedid: Option<TypeDidConversation>,
pub kid: String,
pub nonce: String,
pub ciphertext: String,
pub signature: String,
}Expand description
Encrypted DID message envelope.
Fields§
§id: StringMessage id.
message_type: StringMessage type URI.
from: DidSender DID.
to: Vec<Did>Recipient DIDs.
created_time: u64Creation time as unix seconds.
expires_time: u64Expiration time as unix seconds.
body: DidMessageBodyPolicy-visible message metadata.
typedid: Option<TypeDidConversation>Optional TypeDID conversation/profile metadata.
kid: StringKey id used for authentication.
nonce: StringHex-encoded nonce.
ciphertext: StringHex-encoded ciphertext.
signature: StringHex-encoded signature over the envelope signing input.
Implementations§
Source§impl DidEnvelope
impl DidEnvelope
Sourcepub fn prompt(
id: impl Into<String>,
from: Did,
to: Did,
body: DidMessageBody,
plaintext: impl AsRef<[u8]>,
resolver: &dyn DidResolver,
key_store: &dyn DidKeyStore,
) -> Result<Self, DidError>
pub fn prompt( id: impl Into<String>, from: Did, to: Did, body: DidMessageBody, plaintext: impl AsRef<[u8]>, resolver: &dyn DidResolver, key_store: &dyn DidKeyStore, ) -> Result<Self, DidError>
Create an encrypted prompt envelope.
Sourcepub fn reply(
reply_did: Did,
from: Did,
to: Did,
binding: DidReplyBinding,
plaintext: impl AsRef<[u8]>,
resolver: &dyn DidResolver,
key_store: &dyn DidKeyStore,
) -> Result<Self, DidError>
pub fn reply( reply_did: Did, from: Did, to: Did, binding: DidReplyBinding, plaintext: impl AsRef<[u8]>, resolver: &dyn DidResolver, key_store: &dyn DidKeyStore, ) -> Result<Self, DidError>
Create an encrypted reply envelope bound to a verified prompt envelope.
Sourcepub fn typedid(
id: impl Into<String>,
from: Did,
to: Did,
body: DidMessageBody,
typedid: TypeDidConversation,
plaintext: impl AsRef<[u8]>,
resolver: &dyn DidResolver,
key_store: &dyn DidKeyStore,
) -> Result<Self, DidError>
pub fn typedid( id: impl Into<String>, from: Did, to: Did, body: DidMessageBody, typedid: TypeDidConversation, plaintext: impl AsRef<[u8]>, resolver: &dyn DidResolver, key_store: &dyn DidKeyStore, ) -> Result<Self, DidError>
Create an encrypted TypeDID agent-message envelope.
Sourcepub fn typedid_reply(
id: impl Into<String>,
from: Did,
to: Did,
request: &VerifiedTypeDidMessage,
plaintext: impl AsRef<[u8]>,
resolver: &dyn DidResolver,
key_store: &dyn DidKeyStore,
) -> Result<Self, DidError>
pub fn typedid_reply( id: impl Into<String>, from: Did, to: Did, request: &VerifiedTypeDidMessage, plaintext: impl AsRef<[u8]>, resolver: &dyn DidResolver, key_store: &dyn DidKeyStore, ) -> Result<Self, DidError>
Create an encrypted TypeDID reply envelope bound to a verified request.
Sourcepub fn reference(&self) -> DidMessageReference
pub fn reference(&self) -> DidMessageReference
Stable reference to this signed envelope for reply binding.
Trait Implementations§
Source§impl Clone for DidEnvelope
impl Clone for DidEnvelope
Source§fn clone(&self) -> DidEnvelope
fn clone(&self) -> DidEnvelope
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 DidEnvelope
impl Debug for DidEnvelope
Source§impl<'de> Deserialize<'de> for DidEnvelope
impl<'de> Deserialize<'de> for DidEnvelope
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
impl Eq for DidEnvelope
Source§impl PartialEq for DidEnvelope
impl PartialEq for DidEnvelope
Source§fn eq(&self, other: &DidEnvelope) -> bool
fn eq(&self, other: &DidEnvelope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DidEnvelope
impl Serialize for DidEnvelope
impl StructuralPartialEq for DidEnvelope
Auto Trait Implementations§
impl Freeze for DidEnvelope
impl RefUnwindSafe for DidEnvelope
impl Send for DidEnvelope
impl Sync for DidEnvelope
impl Unpin for DidEnvelope
impl UnsafeUnpin for DidEnvelope
impl UnwindSafe for DidEnvelope
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