Struct diem_crypto::x25519::PrivateKey [−][src]
pub struct PrivateKey(_);
Expand description
This type should be used to deserialize a received private key
Implementations
Obtain the public key part of a private key
To perform a key exchange with another public key
Deserialize an X25119 PrivateKey given the sha512 pre-image of a hash whose least significant half is a canonical X25519 scalar, following the XEdDSA approach.
This will FAIL if the passed-in byte representation converts to a non-canonical scalar in the X25519 sense (and thus cannot correspond to a X25519 valid key without bit-mangling).
This is meant to compensate for the poor key storage capabilities of some key management solutions, and NOT to promote double usage of keys under several schemes, which would lead to BAD vulnerabilities.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
type PublicKeyMaterial = PublicKey
type PublicKeyMaterial = PublicKey
We require public / private types to be coupled, i.e. their associated type is each other. Read more
Returns the associated public key
Generate key material from an RNG. This should generally not be used for production purposes even with a good source of randomness. When possible use hardware crypto to generate and store private keys. Read more
Generate a random key using the shared TEST_SEED