pub struct CoreDocument { /* private fields */ }
Expand description
A DID Document.
Implementations§
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn builder(properties: BTreeMap<String, Value>) -> DocumentBuilder
pub fn builder(properties: BTreeMap<String, Value>) -> DocumentBuilder
Creates a DocumentBuilder
to configure a new CoreDocument
.
This is the same as DocumentBuilder::new
.
Sourcepub fn from_builder(builder: DocumentBuilder) -> Result<CoreDocument, Error>
pub fn from_builder(builder: DocumentBuilder) -> Result<CoreDocument, Error>
Returns a new CoreDocument
based on the DocumentBuilder
configuration.
Sourcepub fn id_mut_unchecked(&mut self) -> &mut CoreDID
pub fn id_mut_unchecked(&mut self) -> &mut CoreDID
Returns a mutable reference to the CoreDocument
id.
§Warning
Changes to the identifier can drastically alter the results of
Self::resolve_method
,
Self::resolve_service
and the related DID URL dereferencing algorithm.
Sourcepub fn controller(&self) -> Option<&OneOrSet<CoreDID>>
pub fn controller(&self) -> Option<&OneOrSet<CoreDID>>
Returns a reference to the CoreDocument
controller.
Sourcepub fn controller_mut(&mut self) -> &mut Option<OneOrSet<CoreDID>>
pub fn controller_mut(&mut self) -> &mut Option<OneOrSet<CoreDID>>
Returns a mutable reference to the CoreDocument
controller.
Sourcepub fn also_known_as(&self) -> &OrderedSet<Url>
pub fn also_known_as(&self) -> &OrderedSet<Url>
Returns a reference to the CoreDocument
alsoKnownAs set.
Sourcepub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
pub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
Returns a mutable reference to the CoreDocument
alsoKnownAs set.
Sourcepub fn verification_method(&self) -> &OrderedSet<VerificationMethod>
pub fn verification_method(&self) -> &OrderedSet<VerificationMethod>
Returns a reference to the CoreDocument
verificationMethod set.
Sourcepub fn authentication(&self) -> &OrderedSet<MethodRef>
pub fn authentication(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument
authentication set.
Sourcepub fn assertion_method(&self) -> &OrderedSet<MethodRef>
pub fn assertion_method(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument
assertionMethod set.
Sourcepub fn key_agreement(&self) -> &OrderedSet<MethodRef>
pub fn key_agreement(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument
keyAgreement set.
Sourcepub fn capability_delegation(&self) -> &OrderedSet<MethodRef>
pub fn capability_delegation(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument
capabilityDelegation set.
Sourcepub fn capability_invocation(&self) -> &OrderedSet<MethodRef>
pub fn capability_invocation(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument
capabilityInvocation set.
Sourcepub fn service(&self) -> &OrderedSet<Service>
pub fn service(&self) -> &OrderedSet<Service>
Returns a reference to the CoreDocument
service set.
Sourcepub fn service_mut_unchecked(&mut self) -> &mut OrderedSet<Service>
pub fn service_mut_unchecked(&mut self) -> &mut OrderedSet<Service>
§Warning
Changing a service’s identifier can drastically alter the results of
Self::resolve_service
and the related DID URL dereferencing algorithm.
Sourcepub fn properties(&self) -> &BTreeMap<String, Value>
pub fn properties(&self) -> &BTreeMap<String, Value>
Returns a reference to the custom CoreDocument
properties.
Sourcepub fn properties_mut_unchecked(&mut self) -> &mut BTreeMap<String, Value>
pub fn properties_mut_unchecked(&mut self) -> &mut BTreeMap<String, Value>
Returns a mutable reference to the custom CoreDocument
properties.
§Warning
The properties returned are not checked against the standard fields in a CoreDocument
. Incautious use can have
undesired consequences such as key collision when attempting to serialize the document or distinct resources (such
as services and methods) being identified by the same DID URL.
Sourcepub fn insert_method(
&mut self,
method: VerificationMethod,
scope: MethodScope,
) -> Result<(), Error>
pub fn insert_method( &mut self, method: VerificationMethod, scope: MethodScope, ) -> Result<(), Error>
Adds a new VerificationMethod
to the document in the given MethodScope
.
§Errors
Returns an error if a method or service with the same fragment already exists.
Sourcepub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
pub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
Removes and returns the VerificationMethod
identified by did_url
from the document.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn remove_method_and_scope(
&mut self,
did_url: &DIDUrl,
) -> Option<(VerificationMethod, MethodScope)>
pub fn remove_method_and_scope( &mut self, did_url: &DIDUrl, ) -> Option<(VerificationMethod, MethodScope)>
Removes and returns the VerificationMethod
from the document. The MethodScope
under which the method was
found is appended to the second position of the returned tuple.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn remove_service(&mut self, id: &DIDUrl) -> Option<Service>
pub fn remove_service(&mut self, id: &DIDUrl) -> Option<Service>
Removes and returns a Service
from the document if it exists.
Sourcepub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
Attaches the relationship to the method resolved by method_query
.
§Errors
Returns an error if the method does not exist or if it is embedded.
To convert an embedded method into a generic verification method, remove it first
and insert it with MethodScope::VerificationMethod
.
Sourcepub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
pub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool, Error>where
Q: Into<DIDUrlQuery<'query>>,
Detaches the relationship from the method resolved by method_query
.
Returns true
if the relationship was found and removed, false
otherwise.
§Errors
Returns an error if the method does not exist or is embedded.
To remove an embedded method, use Self::remove_method
.
§Note
If the method is referenced in the given scope, but the document does not contain the referenced verification method, then the reference will persist in the document (i.e. it is not removed).
Sourcepub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
pub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
Returns a Vec
of verification method references whose verification relationship matches scope
.
If scope
is None
, an iterator over all embedded methods is returned.
Sourcepub fn verification_relationships(&self) -> impl Iterator<Item = &MethodRef>
pub fn verification_relationships(&self) -> impl Iterator<Item = &MethodRef>
Returns an iterator over all verification relationships.
This includes embedded and referenced VerificationMethods
.
Sourcepub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first VerificationMethod
with an id
property matching the
provided method_query
and the verification relationship specified by scope
if present.
Sourcepub fn resolve_method_mut<'query, 'me, Q>(
&'me mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method_mut<'query, 'me, Q>(
&'me mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns a mutable reference to the first VerificationMethod
with an id
property
matching the provided method_query
.
§Warning
Incorrect use of this method can lead to distinct document resources being identified by the same DID URL.
Sourcepub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first Service
with an id
property matching the provided service_query
, if present.
Sourcepub fn try_map<F, G, H, L, M, E>(
self,
id_update: F,
controller_update: G,
methods_update: H,
service_update: L,
error_cast: M,
) -> Result<CoreDocument, E>
pub fn try_map<F, G, H, L, M, E>( self, id_update: F, controller_update: G, methods_update: H, service_update: L, error_cast: M, ) -> Result<CoreDocument, E>
Update the DID components of the document’s id
, controllers, methods and services by applying the provided
fallible maps.
This is an advanced method that can be useful for DID methods that do not know the document’s identifier prior to publishing, but should preferably be avoided otherwise.
§Errors
Any error is returned if any of the functions fail or the updates cause scoped method references to embedded
methods, or methods and services with identical identifiers in the document. In the case where illegal identifiers
are detected the supplied the error_cast
function gets called in order to convert Error
to E
.
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn verify_jws<'jws, T>(
&self,
jws: &'jws str,
detached_payload: Option<&'jws [u8]>,
signature_verifier: &T,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>, Error>where
T: JwsVerifier,
pub fn verify_jws<'jws, T>(
&self,
jws: &'jws str,
detached_payload: Option<&'jws [u8]>,
signature_verifier: &T,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>, Error>where
T: JwsVerifier,
Decodes and verifies the provided JWS according to the passed JwsVerificationOptions
and
JwsVerifier
.
Regardless of which options are passed the following conditions must be met in order for a verification attempt to take place.
- The JWS must be encoded according to the JWS compact serialization.
- The
kid
value in the protected header must be an identifier of a verification method in this DID document, or set explicitly in theoptions
.
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn expand_did_jwk(did_jwk: DIDJwk) -> Result<CoreDocument, Error>
pub fn expand_did_jwk(did_jwk: DIDJwk) -> Result<CoreDocument, Error>
Creates a CoreDocument
from a did:jwk DID.
Trait Implementations§
Source§impl AsRef<CoreDocument> for CoreDocument
impl AsRef<CoreDocument> for CoreDocument
Source§fn as_ref(&self) -> &CoreDocument
fn as_ref(&self) -> &CoreDocument
Source§impl AsRef<CoreDocument> for IotaDocument
impl AsRef<CoreDocument> for IotaDocument
Source§fn as_ref(&self) -> &CoreDocument
fn as_ref(&self) -> &CoreDocument
Source§impl Clone for CoreDocument
impl Clone for CoreDocument
Source§fn clone(&self) -> CoreDocument
fn clone(&self) -> CoreDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CoreDocument
impl Debug for CoreDocument
Source§impl<'de> Deserialize<'de> for CoreDocument
impl<'de> Deserialize<'de> for CoreDocument
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CoreDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CoreDocument, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for CoreDocument
impl Display for CoreDocument
Source§impl From<CoreDocument> for IotaDocument
impl From<CoreDocument> for IotaDocument
Source§fn from(value: CoreDocument) -> IotaDocument
fn from(value: CoreDocument) -> IotaDocument
Source§impl From<IotaDocument> for CoreDocument
impl From<IotaDocument> for CoreDocument
Source§fn from(document: IotaDocument) -> CoreDocument
fn from(document: IotaDocument) -> CoreDocument
Source§impl JwkDocumentExt for CoreDocument
impl JwkDocumentExt for CoreDocument
Source§fn generate_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: JwsAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn generate_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: JwsAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
storage
and insert a new verification method with the corresponding
public key material into the DID document. Read moreSource§fn purge_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
id: &'life2 DIDUrl,
) -> Pin<Box<dyn Future<Output = Result<(), JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn purge_method<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
id: &'life2 DIDUrl,
) -> Pin<Box<dyn Future<Output = Result<(), JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
id
from the document and delete the corresponding key material in
the given storage
. Read moreSource§fn create_jws<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
payload: &'life3 [u8],
options: &'life4 JwsSignatureOptions,
) -> Pin<Box<dyn Future<Output = Result<Jws, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn create_jws<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
payload: &'life3 [u8],
options: &'life4 JwsSignatureOptions,
) -> Pin<Box<dyn Future<Output = Result<Jws, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
payload
according to options
with the storage backed private key corresponding to the
public key material in the verification method identified by the given `fragment. Read moreSource§fn create_credential_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CoreDocument: 'async_trait,
fn create_credential_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwsSignatureOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CoreDocument: 'async_trait,
credential
in accordance with VC Data Model v1.1. Read moreSource§fn create_presentation_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait, K, I, CRED, T>(
&'life0 self,
presentation: &'life1 Presentation<CRED, T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
jws_options: &'life4 JwsSignatureOptions,
jwt_options: &'life5 JwtPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CRED: ToOwned<Owned = CRED> + Serialize + DeserializeOwned + Clone + Sync + 'async_trait,
CoreDocument: 'async_trait,
fn create_presentation_jwt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait, K, I, CRED, T>(
&'life0 self,
presentation: &'life1 Presentation<CRED, T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
jws_options: &'life4 JwsSignatureOptions,
jwt_options: &'life5 JwtPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jwt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
K: JwkStorage + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CRED: ToOwned<Owned = CRED> + Serialize + DeserializeOwned + Clone + Sync + 'async_trait,
CoreDocument: 'async_trait,
presentation
in accordance with VC Data Model v1.1. Read moreSource§impl JwpDocumentExt for CoreDocument
impl JwpDocumentExt for CoreDocument
Source§fn generate_method_jwp<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: ProofAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn generate_method_jwp<'life0, 'life1, 'life2, 'async_trait, K, I>(
&'life0 mut self,
storage: &'life1 Storage<K, I>,
key_type: KeyType,
alg: ProofAlgorithm,
fragment: Option<&'life2 str>,
scope: MethodScope,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
storage
and insert a new verification method with the corresponding
public key material into the DID document. This supports BBS+ keys.Source§fn create_issued_jwp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
jpt_claims: &'life3 JptClaims,
options: &'life4 JwpCredentialOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn create_issued_jwp<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
jpt_claims: &'life3 JptClaims,
options: &'life4 JwpCredentialOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
Source§fn create_presented_jwp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
CoreDocument: 'async_trait,
fn create_presented_jwp<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<String, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
CoreDocument: 'async_trait,
Source§fn create_credential_jpt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwpCredentialOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CoreDocument: 'async_trait,
fn create_credential_jpt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait, K, I, T>(
&'life0 self,
credential: &'life1 Credential<T>,
storage: &'life2 Storage<K, I>,
fragment: &'life3 str,
options: &'life4 JwpCredentialOptions,
custom_claims: Option<BTreeMap<String, Value>>,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
T: ToOwned<Owned = T> + Serialize + DeserializeOwned + Sync + 'async_trait,
CoreDocument: 'async_trait,
credential
.Source§fn create_presentation_jpt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
CoreDocument: 'async_trait,
fn create_presentation_jpt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
presentation: &'life1 mut SelectiveDisclosurePresentation,
method_id: &'life2 str,
options: &'life3 JwpPresentationOptions,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
CoreDocument: 'async_trait,
credential
.Source§impl PartialEq for CoreDocument
impl PartialEq for CoreDocument
Source§impl RevocationDocumentExt for CoreDocument
impl RevocationDocumentExt for CoreDocument
Source§fn revoke_credentials<'query, 'me, Q>(
&'me mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), RevocationError>where
Q: Into<DIDUrlQuery<'query>>,
fn revoke_credentials<'query, 'me, Q>(
&'me mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), RevocationError>where
Q: Into<DIDUrlQuery<'query>>,
RevocationBitmap
service identified by service_query
,
revoke all specified indices
.Source§fn unrevoke_credentials<'query, 'me, Q>(
&mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), RevocationError>where
Q: Into<DIDUrlQuery<'query>>,
fn unrevoke_credentials<'query, 'me, Q>(
&mut self,
service_query: Q,
indices: &[u32],
) -> Result<(), RevocationError>where
Q: Into<DIDUrlQuery<'query>>,
RevocationBitmap
service identified by service_query
,
unrevoke all specified indices
.Source§fn resolve_revocation_bitmap(
&self,
query: DIDUrlQuery<'_>,
) -> Result<RevocationBitmap, RevocationError>
fn resolve_revocation_bitmap( &self, query: DIDUrlQuery<'_>, ) -> Result<RevocationBitmap, RevocationError>
RevocationBitmap
from the referenced service in the DID Document. Read moreSource§impl Serialize for CoreDocument
impl Serialize for CoreDocument
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl TimeframeRevocationExtension for CoreDocument
impl TimeframeRevocationExtension for CoreDocument
Source§fn update<'life0, 'life1, 'life2, 'life3, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
start_validity: Option<Timestamp>,
duration: Duration,
credential_jwp: &'life3 mut JwpIssued,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
fn update<'life0, 'life1, 'life2, 'life3, 'async_trait, K, I>(
&'life0 self,
storage: &'life1 Storage<K, I>,
fragment: &'life2 str,
start_validity: Option<Timestamp>,
duration: Duration,
credential_jwp: &'life3 mut JwpIssued,
) -> Pin<Box<dyn Future<Output = Result<Jpt, JwkStorageDocumentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
K: JwkStorageBbsPlusExt + 'async_trait,
I: KeyIdStorage + 'async_trait,
CoreDocument: 'async_trait,
Source§impl TryFrom<CoreDocumentData> for CoreDocument
impl TryFrom<CoreDocumentData> for CoreDocument
impl Eq for CoreDocument
impl StructuralPartialEq for CoreDocument
Auto Trait Implementations§
impl Freeze for CoreDocument
impl RefUnwindSafe for CoreDocument
impl Send for CoreDocument
impl Sync for CoreDocument
impl Unpin for CoreDocument
impl UnwindSafe for CoreDocument
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> ConvertTo<T> for Twhere
T: Send,
impl<T> ConvertTo<T> for Twhere
T: Send,
fn convert(self) -> Result<T, Error>
fn convert_unchecked(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
Source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self
from a string of JSON text.Source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self
from bytes of JSON text.Source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self
from a serde_json::Value
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.Source§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
Source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self
as a serde_json::Value
.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.