Skip to main content

Sign

Struct Sign 

Source
pub struct Sign {
    pub public_key: Option<PublicKey>,
    pub secret_key: Option<SecretKey>,
    pub signed_msg: Option<SignedMessage>,
    pub signature: Option<DetachedSignature>,
}

Fields§

§public_key: Option<PublicKey>§secret_key: Option<SecretKey>§signed_msg: Option<SignedMessage>§signature: Option<DetachedSignature>

Implementations§

Source§

impl Sign

Source

pub fn new() -> Result<Self, SigningErr>

Source

pub async fn set_public_key(&mut self, public_key: PublicKey)

Source

pub async fn set_secret_key(&mut self, secret_key: SecretKey)

Source

pub async fn set_signed_msg(&mut self, signed_msg: SignedMessage)

Source

pub async fn set_signature(&mut self, signature: DetachedSignature)

Source

pub async fn save_signed_msg( &self, base_path: &str, title: &str, ) -> Result<(), SigningErr>

Source

pub async fn save_keys( &self, base_path: &str, title: &str, ) -> Result<(), SigningErr>

Source

pub async fn public_key(&self) -> Option<&PublicKey>

Source

pub async fn secret_key(&self) -> Option<&SecretKey>

Source

pub async fn signed_msg(&self) -> Option<&SignedMessage>

Source

pub async fn signature(&self) -> Option<&DetachedSignature>

Source

pub async fn load_secret_key( &mut self, path: PathBuf, ) -> Result<&SecretKey, SigningErr>

Source

pub async fn load_public_key( &mut self, path: PathBuf, ) -> Result<&PublicKey, SigningErr>

Source

pub async fn load_signed_msg( &mut self, path: PathBuf, ) -> Result<&SignedMessage, SigningErr>

Source

pub async fn load_signature( &mut self, path: PathBuf, ) -> Result<&DetachedSignature, SigningErr>

Source

pub async fn sign_msg(&mut self, message: &[u8]) -> Result<&[u8], SigningErr>

Source

pub async fn sign_file( &mut self, file_path: PathBuf, ) -> Result<Vec<u8>, SigningErr>

Source

pub async fn signing_detached( &mut self, message: &[u8], ) -> Result<DetachedSignature, SigningErr>

Source

pub async fn verify_msg(&self, message: &[u8]) -> Result<Vec<u8>, SigningErr>

Source

pub async fn verify_detached(&self, message: &[u8]) -> Result<bool, SigningErr>

Auto Trait Implementations§

§

impl Freeze for Sign

§

impl RefUnwindSafe for Sign

§

impl Send for Sign

§

impl Sync for Sign

§

impl Unpin for Sign

§

impl UnsafeUnpin for Sign

§

impl UnwindSafe for Sign

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.