[−][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(kp_type: KeyPairType) -> 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 new_module() -> KeyPair
[src]
Creates a new module (e.g. WebAssembly) key pair with a seed that has the M 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
Trait Implementations
impl Clone for KeyPair
[src]
fn clone(&self) -> KeyPair
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for KeyPair
[src]
Auto Trait Implementations
impl Send for KeyPair
impl Unpin for KeyPair
impl Sync for KeyPair
impl UnwindSafe for KeyPair
impl RefUnwindSafe for KeyPair
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self