[−][src]Struct nkeys::KeyPair
The main interface used for reading and writing nkey-encoded key pairs, including seeds and public keys. Instances of this type cannot be cloned.
Implementations
impl KeyPair[src]
pub fn new(kp_type: KeyPairType) -> KeyPair[src]
Creates a new key pair of the given type
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 new_service() -> KeyPair[src]
Creates a new service / service provider key pair with a seed that has the V prefix
pub fn public_key(&self) -> String[src]
Returns the encoded, human-readable 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, human-readable string for this key pair's seed. Remember that this value should be treated as a secret. Do not store it for any longer than necessary
pub fn from_public_key(source: &str) -> Result<KeyPair, Error>[src]
Attempts to produce a public-only key pair from the given encoded public key 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
Auto Trait Implementations
impl RefUnwindSafe for KeyPair[src]
impl Send for KeyPair[src]
impl Sync for KeyPair[src]
impl Unpin for KeyPair[src]
impl UnwindSafe for KeyPair[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &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> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,