Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::Sr25519Provider Class Referenceabstract

#include <sr25519_provider.hpp>

Inheritance diagram for kagome::crypto::Sr25519Provider:
Collaboration diagram for kagome::crypto::Sr25519Provider:

Public Member Functions

virtual ~Sr25519Provider ()=default
 
virtual Sr25519KeypairAndSeed generateKeypair () const =0
 
virtual Sr25519Keypair generateKeypair (const Sr25519Seed &seed) const =0
 
virtual outcome::result< Sr25519Signature > sign (const Sr25519Keypair &keypair, gsl::span< const uint8_t > message) const =0
 
virtual outcome::result< bool > verify (const Sr25519Signature &signature, gsl::span< const uint8_t > message, const Sr25519PublicKey &public_key) const =0
 
virtual outcome::result< bool > verify_deprecated (const Sr25519Signature &signature, gsl::span< const uint8_t > message, const Sr25519PublicKey &public_key) const =0
 

Detailed Description

Definition at line 25 of file sr25519_provider.hpp.

Constructor & Destructor Documentation

virtual kagome::crypto::Sr25519Provider::~Sr25519Provider ( )
virtualdefault

Member Function Documentation

virtual Sr25519KeypairAndSeed kagome::crypto::Sr25519Provider::generateKeypair ( ) const
pure virtual

Generates random keypair for signing the message

Implemented in kagome::crypto::Sr25519ProviderImpl.

virtual Sr25519Keypair kagome::crypto::Sr25519Provider::generateKeypair ( const Sr25519Seed &  seed) const
pure virtual

Generate random keypair from seed

Implemented in kagome::crypto::Sr25519ProviderImpl.

virtual outcome::result<Sr25519Signature> kagome::crypto::Sr25519Provider::sign ( const Sr25519Keypair keypair,
gsl::span< const uint8_t >  message 
) const
pure virtual

Sign message

Parameters
msgusing
keypair.If computed value is less than
thresholdthen return optional containing this value and proof. Otherwise none returned
keypairpair of public and secret sr25519 keys
messagebytes to be signed
Returns
signed message

Implemented in kagome::crypto::Sr25519ProviderImpl.

virtual outcome::result<bool> kagome::crypto::Sr25519Provider::verify ( const Sr25519Signature &  signature,
gsl::span< const uint8_t >  message,
const Sr25519PublicKey &  public_key 
) const
pure virtual

Verifies that

Parameters
messagewas derived using
public_keyon
signature

Implemented in kagome::crypto::Sr25519ProviderImpl.

virtual outcome::result<bool> kagome::crypto::Sr25519Provider::verify_deprecated ( const Sr25519Signature &  signature,
gsl::span< const uint8_t >  message,
const Sr25519PublicKey &  public_key 
) const
pure virtual

The documentation for this class was generated from the following file: