[][src]Trait casper_node::crypto::AsymmetricKeyExt

pub trait AsymmetricKeyExt: Sized {
    pub fn generate_ed25519() -> Result<Self, Error>;
pub fn generate_secp256k1() -> Result<Self, Error>;
pub fn to_file<P: AsRef<Path>>(&self, file: P) -> Result<(), Error>;
pub fn from_file<P: AsRef<Path>>(file: P) -> Result<Self, Error>;
pub fn to_der(&self) -> Result<Vec<u8>, Error>;
pub fn from_der<T: AsRef<[u8]>>(input: T) -> Result<Self, Error>;
pub fn to_pem(&self) -> Result<String, Error>;
pub fn from_pem<T: AsRef<[u8]>>(input: T) -> Result<Self, Error>;
pub fn doc_example() -> &'static Self; }

Additional operations an asymmetric key

Required methods

pub fn generate_ed25519() -> Result<Self, Error>[src]

Constructs a new ed25519 variant using the operating system's cryptographically secure random number generator.

pub fn generate_secp256k1() -> Result<Self, Error>[src]

Constructs a new secp256k1 variant using the operating system's cryptographically secure random number generator.

pub fn to_file<P: AsRef<Path>>(&self, file: P) -> Result<(), Error>[src]

Attempts to write the key bytes to the configured file path.

pub fn from_file<P: AsRef<Path>>(file: P) -> Result<Self, Error>[src]

Attempts to read the key bytes from configured file path.

pub fn to_der(&self) -> Result<Vec<u8>, Error>[src]

DER encodes a key.

pub fn from_der<T: AsRef<[u8]>>(input: T) -> Result<Self, Error>[src]

Decodes a key from a DER-encoded slice.

pub fn to_pem(&self) -> Result<String, Error>[src]

PEM encodes a key.

pub fn from_pem<T: AsRef<[u8]>>(input: T) -> Result<Self, Error>[src]

Decodes a secret key from a PEM-encoded slice.

pub fn doc_example() -> &'static Self[src]

Returns an example value for documentation purposes.

Loading content...

Implementations on Foreign Types

impl AsymmetricKeyExt for SecretKey[src]

impl AsymmetricKeyExt for PublicKey[src]

Loading content...

Implementors

Loading content...