Add methods to get version and public key of keypairs
This commit is contained in:
parent
c94eecac0c
commit
1ca545cba8
10
src/keys.rs
10
src/keys.rs
@ -64,6 +64,16 @@ impl Ed25519KeyPair {
|
|||||||
|
|
||||||
Ok(document.as_ref().to_vec())
|
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 {
|
impl KeyPair for Ed25519KeyPair {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user