[][src]Trait rcrypto::Signature

pub trait Signature<T> {
    type Output;
    fn sign(
        &mut self,
        signature: &mut T,
        message: &[u8]
    ) -> Result<Self::Output, CryptoError>;
fn verify(
        &mut self,
        signature: &T,
        message: &[u8]
    ) -> Result<Self::Output, CryptoError>; }

A trait for signature algorithms

Associated Types

type Output

Loading content...

Required methods

fn sign(
    &mut self,
    signature: &mut T,
    message: &[u8]
) -> Result<Self::Output, CryptoError>

fn verify(
    &mut self,
    signature: &T,
    message: &[u8]
) -> Result<Self::Output, CryptoError>

Loading content...

Implementors

impl<H, R> Signature<SignatureContent> for DSA<H, R> where
    H: Digest,
    R: IterSource<u32>, 
[src]

type Output = ()

impl<H, R> Signature<SignatureContent> for PKCS1<H, R> where
    H: Digest + Any,
    R: IterSource<u32>, 
[src]

type Output = ()

fn sign(
    &mut self,
    signature: &mut SignatureContent,
    message: &[u8]
) -> Result<Self::Output, CryptoError>
[src]

the length of message should be less than or equal to self.sign_max_message_len()

fn verify(
    &mut self,
    signature: &SignatureContent,
    message: &[u8]
) -> Result<Self::Output, CryptoError>
[src]

the length of signature should be equal to self.modulus_len()

impl<H, R> Signature<SignatureContent> for PSS<H, R> where
    H: Digest,
    R: IterSource<u32>, 
[src]

type Output = ()

fn sign(
    &mut self,
    signature: &mut SignatureContent,
    message: &[u8]
) -> Result<Self::Output, CryptoError>
[src]

the length of message should be less than or equal to self.digest_len() + self.salt_len() + 2

fn verify(
    &mut self,
    signature: &SignatureContent,
    message: &[u8]
) -> Result<Self::Output, CryptoError>
[src]

the length of signature should be equal to self.modulus_len()

impl<H, R, C> Signature<SignatureContent> for ECDSA<H, R, C> where
    H: Digest,
    R: IterSource<u32>,
    C: EllipticCurve
[src]

type Output = ()

Loading content...