[−][src]Trait mundane::public::Signature
A cryptographic signature generated by a private key.
Associated Types
type PrivateKey: PrivateKey
The private key type used to generate this signature.
Required methods
#[must_use]
fn sign(key: &Self::PrivateKey, message: &[u8]) -> Result<Self, Error>
Sign a message.
The input to this function is always a message, never a digest. If a
signature scheme calls for hashing a message and signing the hash
digest, sign
is responsible for both hashing and signing.
#[must_use]
fn is_valid(
&self,
key: &<Self::PrivateKey as PrivateKey>::Public,
message: &[u8]
) -> bool
&self,
key: &<Self::PrivateKey as PrivateKey>::Public,
message: &[u8]
) -> bool
Verify a signature.
The input to this function is always a message, never a digest. If a
signature scheme calls for hashing a message and signing the hash
digest, is_valid
is responsible for both hashing and verifying the
digest.
Implementors
impl Signature for Ed25519Signature
[src]
type PrivateKey = Ed25519PrivKey
fn sign(key: &Ed25519PrivKey, message: &[u8]) -> Result<Ed25519Signature, Error>
[src]
Sign a message.
Though the Signature
trait requires that sign
return a Result
,
Ed25519Signature
's implementation is guaranteed to always return Ok
.
Callers may prefer the sign_ed25519
function, which returns an
Ed25519Signature
rather than a Result
.
fn is_valid(&self, key: &Ed25519PubKey, message: &[u8]) -> bool
[src]
impl<B: RsaKeyBits, S: RsaSignatureScheme, H: Hasher> Signature for RsaSignature<B, S, H>
[src]
type PrivateKey = RsaPrivKey<B>
fn sign(
key: &RsaPrivKey<B>,
message: &[u8]
) -> Result<RsaSignature<B, S, H>, Error>
[src]
key: &RsaPrivKey<B>,
message: &[u8]
) -> Result<RsaSignature<B, S, H>, Error>