Add methods to get version and public key of keypairs

This commit is contained in:
timokoesters 2020-04-23 14:25:15 +02:00
parent c94eecac0c
commit 1ca545cba8
No known key found for this signature in database
GPG Key ID: 24DA7517711A2BA4

View File

@ -64,6 +64,16 @@ impl Ed25519KeyPair {
Ok(document.as_ref().to_vec())
}
/// Returns the version string for this keypair.
pub fn version(&self) -> &str {
&self.version
}
/// Returns the public key.
pub fn public_key(&self) -> &[u8] {
self.keypair.public_key().as_ref()
}
}
impl KeyPair for Ed25519KeyPair {