[−][src]Struct activeledger::key::RSA
Fields
name: String
Methods
impl RSA
[src]
pub fn new(name: &str) -> KeyResult<RSA>
[src]
pub fn create_from_pem(name: &str, pem: &Pkcs8pem) -> RSA
[src]
pub fn sign(&self, data: &str) -> KeyResult<String>
[src]
Sign the given data
Example
let rsa = RSA::new("keyname").unwrap(); let signature = rsa.sign("Data to sign").unwrap();
pub fn verify(&self, data: &str, signature: &str) -> KeyResult<bool>
[src]
Verify a signature against some data
Example
let rsa = RSA::new("keyname").unwrap(); let data_to_sign = String::from("Data to sign"); let signature: String = rsa.sign(&data_to_sign).unwrap(); let verify: bool = rsa.verify(&data_to_sign, &signature).unwrap();
pub fn get_pem(&self) -> KeyResult<Pkcs8pem>
[src]
Get a keys PEM as string values
Example
let rsa = RSA::new("keyname").unwrap(); let pem: Pkcs8pem = rsa.get_pem().unwrap();
Trait Implementations
Auto Trait Implementations
impl Send for RSA
impl Sync for RSA
impl Unpin for RSA
impl UnwindSafe for RSA
impl RefUnwindSafe for RSA
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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, 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,