pub struct Signature { /* private fields */ }alloc only.Expand description
Low-level digital signature (e.g. DSA, ECDSA, Ed25519).
These are low-level signatures used as part of the OpenSSH certificate
format to represent signatures by certificate authorities (CAs), as well
as the higher-level SshSig format, which provides
general-purpose signing functionality using SSH keys.
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§
Source§impl 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::Encodingif the signature is not the correct length.
Trait Implementations§
Source§impl Encode for Signature
impl Encode for Signature
Source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Writer.Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32 length prefix.Source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32 length prefix
set to Encode::encoded_len.Source§impl Ord for Signature
impl Ord for Signature
Source§impl PartialOrd for Signature
impl PartialOrd for Signature
Source§impl SignatureEncoding for Signature
impl SignatureEncoding for Signature
Source§impl Signer<Signature> for (&RsaKeypair, Option<HashAlg>)
Available on crate feature rsa only.
impl Signer<Signature> for (&RsaKeypair, Option<HashAlg>)
rsa only.Source§impl Signer<Signature> for DsaKeypair
Available on crate feature dsa only.
impl Signer<Signature> for DsaKeypair
dsa only.Source§impl Signer<Signature> for EcdsaKeypair
Available on crate features p256 or p384 or p521 only.
impl Signer<Signature> for EcdsaKeypair
p256 or p384 or p521 only.Source§impl Signer<Signature> for EcdsaPrivateKey<32>
Available on crate feature p256 only.
impl Signer<Signature> for EcdsaPrivateKey<32>
p256 only.Source§impl Signer<Signature> for EcdsaPrivateKey<48>
Available on crate feature p384 only.
impl Signer<Signature> for EcdsaPrivateKey<48>
p384 only.Source§impl Signer<Signature> for EcdsaPrivateKey<66>
Available on crate feature p521 only.
impl Signer<Signature> for EcdsaPrivateKey<66>
p521 only.Source§impl Signer<Signature> for Ed25519Keypair
Available on crate feature ed25519 only.
impl Signer<Signature> for Ed25519Keypair
ed25519 only.Source§impl Signer<Signature> for KeypairData
impl Signer<Signature> for KeypairData
Source§impl Signer<Signature> for PrivateKey
impl Signer<Signature> for PrivateKey
Source§impl Signer<Signature> for RsaKeypair
Available on crate feature rsa only.
impl Signer<Signature> for RsaKeypair
rsa only.Source§impl Verifier<Signature> for DsaPublicKey
Available on crate feature dsa only.
impl Verifier<Signature> for DsaPublicKey
dsa only.Source§impl Verifier<Signature> for EcdsaPublicKey
Available on crate features p256 or p384 or p521 only.
impl Verifier<Signature> for EcdsaPublicKey
p256 or p384 or p521 only.Source§impl Verifier<Signature> for Ed25519PublicKey
Available on crate feature ed25519 only.
impl Verifier<Signature> for Ed25519PublicKey
ed25519 only.Source§impl Verifier<Signature> for RsaPublicKey
Available on crate feature rsa only.
impl Verifier<Signature> for RsaPublicKey
rsa only.Source§impl Verifier<Signature> for SkEcdsaSha2NistP256
Available on crate feature p256 only.
impl Verifier<Signature> for SkEcdsaSha2NistP256
p256 only.impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
self into the result. Upper case
letters are used (e.g. F9B4CA)