AnySuite

Enum AnySuite 

Source
pub enum AnySuite {
    RsaSignature2018,
    Ed25519Signature2018,
    Ed25519Signature2020,
    EdDsa2022,
    EdDsaRdfc2022,
    EcdsaSecp256k1Signature2019,
    EcdsaSecp256r1Signature2019,
    EcdsaRdfc2019,
    EcdsaSd2023,
    JsonWebSignature2020,
    Unknown(UnknownSuite),
}
Expand description

Built-in Data Integrity cryptographic suites.

Variants§

§

RsaSignature2018

W3C RSA Signature Suite 2018.

See: https://w3c-ccg.github.io/lds-rsa2018/

§

Ed25519Signature2018

W3C Ed25519 Signature 2018.

See: https://w3c-ccg.github.io/lds-ed25519-2018/

§

Ed25519Signature2020

§

EdDsa2022

W3C eddsa-2022 cryptosuite, a draft version of the eddsa-rdfc-2022 cryptosuite.

See: https://www.w3.org/TR/2023/WD-vc-di-eddsa-20230714/#eddsa-2022

§

EdDsaRdfc2022

W3C eddsa-rdfc-2022 cryptosuite.

See: https://w3c.github.io/vc-di-eddsa/#eddsa-rdfc-2022

§

EcdsaSecp256k1Signature2019

W3C Ecdsa Secp256k1 Signature 2019.

See: https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/

§

EcdsaSecp256r1Signature2019

§

EcdsaRdfc2019

§

EcdsaSd2023

§

JsonWebSignature2020

W3C JSON Web Signature 2020.

See: https://w3c-ccg.github.io/lds-jws2020/

§

Unknown(UnknownSuite)

Unknown cryptographic suite.

This variant exists to ensure that it will always be possible to parse a verifiable credential or presentation secured with AnySuite, even if the suite is not supported by this library.

Implementations§

Source§

impl AnySuite

Source

pub fn pick( jwk: &JWK, verification_method: Option<&ReferenceOrOwned<AnyMethod>>, ) -> Option<Self>

Trait Implementations§

Source§

impl Clone for AnySuite

Source§

fn clone(&self) -> AnySuite

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConfigurationAlgorithm<AnySuite> for AnyConfigurationAlgorithm

Source§

type InputVerificationMethod = AnyMethod

Input type for the verification method.
Source§

type InputSuiteOptions = AnyInputSuiteOptions

Input suite-specific proof options. Read more
Source§

type InputSignatureOptions = AnySignatureOptions

Input suite-specific signature options. Read more
Source§

type InputVerificationOptions = ()

Input suite-specific verification options. Read more
Source§

type TransformationOptions = AnyTransformationOptions

Document transformation options.
Source§

fn configure_signature( suite: &AnySuite, options: InputProofOptions<AnySuite>, signature_options: AnySignatureOptions, ) -> Result<(ProofConfiguration<AnySuite>, AnyTransformationOptions), ConfigurationError>

Source§

fn configure_verification( suite: &AnySuite, verification_options: &(), ) -> Result<AnyTransformationOptions, ConfigurationError>

Source§

impl CryptographicSuite for AnySuite

Source§

type Configuration = AnyConfigurationAlgorithm

Configuration algorithm, used to generate the proof configuration from the input options. Read more
Source§

type PreparedClaims = AnyPreparedClaims

How prepared claims are stored. Read more
Source§

type VerificationMethod = AnySuiteVerificationMethod

Verification method.
Source§

type Signature = AnySignature

Signature type. Read more
Source§

type ProofOptions = AnyProofOptions

Suite-specific proof options used to generate the proof.
Source§

fn type_(&self) -> TypeRef<'_>

Returns the cryptographic suite type.
Source§

fn configure_signature( &self, proof_options: ProofOptions<<Self::Configuration as ConfigurationAlgorithm<Self>>::InputVerificationMethod, <Self::Configuration as ConfigurationAlgorithm<Self>>::InputSuiteOptions>, signature_options: <Self::Configuration as ConfigurationAlgorithm<Self>>::InputSignatureOptions, ) -> Result<(ProofConfiguration<Self>, <Self::Configuration as ConfigurationAlgorithm<Self>>::TransformationOptions), ConfigurationError>

Generates a proof configuration from input options.
Source§

fn configure_verification( &self, verification_options: &<Self::Configuration as ConfigurationAlgorithm<Self>>::InputVerificationOptions, ) -> Result<<Self::Configuration as ConfigurationAlgorithm<Self>>::TransformationOptions, ConfigurationError>

Generates a proof configuration from input options.
Source§

async fn sign_with<T, C, R, S>( &self, context: C, unsecured_document: T, resolver: R, signer: S, proof_options: ProofOptions<<Self::Configuration as ConfigurationAlgorithm<Self>>::InputVerificationMethod, <Self::Configuration as ConfigurationAlgorithm<Self>>::InputSuiteOptions>, signature_options: <Self::Configuration as ConfigurationAlgorithm<Self>>::InputSignatureOptions, ) -> Result<DataIntegrity<T, Self>, SignatureError>
where Self: CryptographicSuiteSigning<T, C, R, S>,

Generates a verifiable document secured with this cryptographic suite.
Source§

async fn sign<T, R, S>( &self, unsecured_document: T, resolver: R, signer: S, proof_options: ProofOptions<<Self::Configuration as ConfigurationAlgorithm<Self>>::InputVerificationMethod, <Self::Configuration as ConfigurationAlgorithm<Self>>::InputSuiteOptions>, ) -> Result<DataIntegrity<T, Self>, SignatureError>

Generates a verifiable document secured with this cryptographic suite.
Source§

impl<T, P> CryptographicSuiteSelect<T, P> for AnySuite

Source§

async fn select( &self, unsecured_document: &T, proof: ProofRef<'_, Self>, params: P, options: Self::SelectionOptions, ) -> Result<DataIntegrity<Object, Self>, SelectionError>

Select a subset of claims to disclose.
Source§

impl<T, C, R, S> CryptographicSuiteSigning<T, C, R, S> for AnySuite

Source§

async fn generate_signature( &self, context: &C, resolver: R, signer: S, claims: &T, proof_configuration: ProofConfigurationRef<'_, Self>, transformation_options: AnyTransformationOptions, ) -> Result<Self::Signature, SignatureError>

Source§

impl<T, V> CryptographicSuiteVerification<T, V> for AnySuite

Source§

async fn verify_proof( &self, verifier: &V, claims: &T, proof: ProofRef<'_, Self>, transformation_options: AnyTransformationOptions, ) -> Result<ProofValidity, ProofValidationError>

Source§

impl Debug for AnySuite

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> DeserializeTyped<'de, AnySuite> for AnyProofOptions

Source§

fn deserialize_typed<D>( suite: &AnySuite, deserializer: D, ) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de> DeserializeTyped<'de, AnySuite> for AnySignature

Source§

fn deserialize_typed<D>( suite: &AnySuite, deserializer: D, ) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Source§

impl<'de> DeserializeTyped<'de, AnySuite> for AnySuiteVerificationMethod

Source§

fn deserialize_typed<D>( suite: &AnySuite, deserializer: D, ) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Source§

impl From<Type> for AnySuite

Source§

fn from(ty: Type) -> Self

Converts to this type from the input type.
Source§

impl Hash for AnySuite

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for AnySuite

Source§

fn cmp(&self, other: &AnySuite) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for AnySuite

Source§

fn eq(&self, other: &AnySuite) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for AnySuite

Source§

fn partial_cmp(&self, other: &AnySuite) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl SelectiveCryptographicSuite for AnySuite

Source§

type SelectionOptions = AnySelectionOptions

Options specifying what claims to select and how.
Source§

impl Eq for AnySuite

Source§

impl StructuralPartialEq for AnySuite

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<S> CloneCryptographicSuite for S

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<S> DebugCryptographicSuite for S

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> ResourceProvider<()> for T

Source§

fn get_resource(&self) -> &()

Returns a reference to the resource of type T.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerializeCryptographicSuite for T

Source§

fn serialize_verification_method<S>( verification_method: &<T as CryptographicSuite>::VerificationMethod, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

fn serialize_verification_method_ref<S>( verification_method: &ReferenceOrOwned<<T as CryptographicSuite>::VerificationMethod>, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

fn serialize_verification_method_ref_ref<S>( verification_method: &ReferenceOrOwnedRef<'_, <T as CryptographicSuite>::VerificationMethod>, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

fn serialize_proof_options<S>( proof_options: &<T as CryptographicSuite>::ProofOptions, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

fn serialize_signature<S>( signature: &<T as CryptographicSuite>::Signature, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

fn serialize_type<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToOwned for T

Source§

type Owned = T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>

Source§

impl<S> DeserializeCryptographicSuiteOwned for S
where S: for<'de> DeserializeCryptographicSuite<'de>,