Struct identity_core::crypto::KeyPair
source · pub struct KeyPair { /* private fields */ }
Expand description
A convenient type for representing a pair of cryptographic keys.
Implementations§
source§impl KeyPair
impl KeyPair
sourcepub fn try_from_private_key_bytes(
key_type: KeyType,
private_key_bytes: &[u8]
) -> Result<Self>
pub fn try_from_private_key_bytes( key_type: KeyType, private_key_bytes: &[u8] ) -> Result<Self>
Reconstructs a KeyPair
from the bytes of a private key.
The private key for Ed25519
must be a 32-byte seed in compliance
with RFC 8032.
Other implementations often use another format. See this blog post for further explanation.
sourcepub const fn private(&self) -> &PrivateKey
pub const fn private(&self) -> &PrivateKey
Returns a reference to the PrivateKey
object.