pub struct Signature { /* private fields */ }
alloc
only.Expand description
Digital signature (e.g. DSA, ECDSA, Ed25519).
These are used as part of the OpenSSH certificate format to represent signatures by certificate authorities (CAs).
From OpenSSH’s PROTOCOL.certkeys specification:
Signatures are computed and encoded according to the rules defined for the CA’s public key algorithm (RFC4253 section 6.6 for ssh-rsa and ssh-dss, RFC5656 for the ECDSA types, and RFC8032 for Ed25519).
RSA signature support is implemented using the SHA2 family extensions as described in RFC8332.
Implementations
sourceimpl Signature
impl Signature
sourcepub fn new(algorithm: Algorithm, data: impl Into<Vec<u8>>) -> Result<Self>
pub fn new(algorithm: Algorithm, data: impl Into<Vec<u8>>) -> Result<Self>
Create a new signature with the given algorithm and raw signature data.
See specifications in toplevel Signature
documentation for how to
format the raw signature data for a given algorithm.
Returns
Error::Length
if the signature is not the correct length.
Trait Implementations
sourceimpl Ord for Signature
impl Ord for Signature
sourceimpl PartialOrd<Signature> for Signature
impl PartialOrd<Signature> for Signature
sourcefn partial_cmp(&self, other: &Signature) -> Option<Ordering>
fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Signer<Signature> for PrivateKey
impl Signer<Signature> for PrivateKey
sourceimpl Signer<Signature> for KeypairData
impl Signer<Signature> for KeypairData
sourceimpl Signer<Signature> for Ed25519Keypair
This is supported on crate feature ed25519
only.
impl Signer<Signature> for Ed25519Keypair
ed25519
only.sourceimpl Signer<Signature> for EcdsaKeypair
This is supported on crate feature p256
only.
impl Signer<Signature> for EcdsaKeypair
p256
only.sourceimpl Signer<Signature> for EcdsaPrivateKey<32>
This is supported on crate feature p256
only.
impl Signer<Signature> for EcdsaPrivateKey<32>
p256
only.sourceimpl Signer<Signature> for RsaKeypair
This is supported on crate feature rsa
only.
impl Signer<Signature> for RsaKeypair
rsa
only.sourceimpl TryFrom<&'_ Signature<NistP256>> for Signature
This is supported on crate feature p256
only.
impl TryFrom<&'_ Signature<NistP256>> for Signature
p256
only.sourceimpl Verifier<Signature> for Ed25519PublicKey
This is supported on crate feature ed25519
only.
impl Verifier<Signature> for Ed25519PublicKey
ed25519
only.sourceimpl Verifier<Signature> for EcdsaPublicKey
This is supported on crate feature p256
only.
impl Verifier<Signature> for EcdsaPublicKey
p256
only.sourceimpl Verifier<Signature> for RsaPublicKey
This is supported on crate feature rsa
only.
impl Verifier<Signature> for RsaPublicKey
rsa
only.impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more