HashableCredential

Trait HashableCredential 

Source
pub trait HashableCredential {
    // Required methods
    fn claims_hash(&self) -> Result<FieldElement, Error>;
    fn hash(&self) -> Result<FieldElement, Error>;
    fn verify_signature(
        &self,
        expected_issuer_pubkey: &EdDSAPublicKey,
    ) -> Result<bool, Error>;
}
Expand description

Introduces hashing and signing capabilities to the Credential type.

Required Methods§

Source

fn claims_hash(&self) -> Result<FieldElement, Error>

Get the claims hash of the credential.

§Errors

Will error if there are more claims than the maximum allowed. Will error if the claims cannot be lowered into the field. Should not occur in practice.

Source

fn hash(&self) -> Result<FieldElement, Error>

The hash is signed by the issuer to provide authenticity for the credential.

§Errors
  • Will error if there are more claims than the maximum allowed.
  • Will error if the claims cannot be lowered into the field. Should not occur in practice.
Source

fn verify_signature( &self, expected_issuer_pubkey: &EdDSAPublicKey, ) -> Result<bool, Error>

Verify the signature of the credential against the issuer public key and expected hash.

§Errors

Will error if the credential is not signed. Will error if the credential cannot be hashed.

Implementors§