Trait CryptoImplementation

Source
pub trait CryptoImplementation {
    // Required methods
    fn derive_keypair(
        &self,
        decoded_seed: &[u8],
        is_validator: bool,
    ) -> XRPLCoreResult<(String, String)>;
    fn sign(&self, message: &[u8], private_key: &str) -> XRPLCoreResult<Vec<u8>>;
    fn is_valid_message(
        &self,
        message: &[u8],
        signature: &str,
        public_key: &str,
    ) -> bool;
}
Expand description

Trait for cryptographic algorithms in the XRP Ledger. The classes for all cryptographic algorithms are derived from this trait.

Required Methods§

Source

fn derive_keypair( &self, decoded_seed: &[u8], is_validator: bool, ) -> XRPLCoreResult<(String, String)>

Derives a key pair for use with the XRP Ledger from a seed value.

Source

fn sign(&self, message: &[u8], private_key: &str) -> XRPLCoreResult<Vec<u8>>

Signs a message using a given private key.

  • message - Text about foo.
  • private_key - Text about bar.
Source

fn is_valid_message( &self, message: &[u8], signature: &str, public_key: &str, ) -> bool

Verifies the signature on a given message.

Implementors§