[−][src]Struct nkeys::KeyPair
The main interface used for reading and writing nkey-encoded key pairs, including seeds and public keys.
Methods
impl KeyPair
[src]
pub fn new_user() -> KeyPair
[src]
Creates a new user key pair with a seed that has a U prefix
pub fn new_account() -> KeyPair
[src]
Creates a new account key pair with a seed that has an A prefix
pub fn new_operator() -> KeyPair
[src]
Creates a new operator key pair with a seed that has an O prefix
pub fn new_cluster() -> KeyPair
[src]
Creates a new cluster key pair with a seed that has the C prefix
pub fn new_server() -> KeyPair
[src]
Creates a new server key pair with a seed that has the N prefix
pub fn public_key(&self) -> String
[src]
Returns the encoded public key of this key pair
pub fn sign(&self, input: &[u8]) -> Result<Vec<u8>, Error>
[src]
Attempts to sign the given input with the key pair's seed
pub fn verify(&self, input: &[u8], sig: &[u8]) -> Result<(), Error>
[src]
Attempts to verify that the given signature is valid for the given input
pub fn seed(&self) -> Result<String, Error>
[src]
Attempts to return the encoded string for this key pair's seed. Remember that this value should be treated as a secret
pub fn from_public_key(source: &str) -> Result<KeyPair, Error>
[src]
Attempts to produce a public-only key pair from the given encoded string
pub fn from_seed(source: &str) -> Result<KeyPair, Error>
[src]
Attempts to produce a full key pair from the given encoded seed string
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self