Struct ssh_protocol::Signature
source · pub struct Signature { /* private fields */ }
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<Signature, Error>
pub fn new( algorithm: Algorithm, data: impl Into<Vec<u8>>, ) -> Result<Signature, Error>
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::Encoding
if 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, Error>
fn encoded_len(&self) -> Result<usize, Error>
source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
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 PartialEq for Signature
impl PartialEq for Signature
source§impl PartialOrd for Signature
impl PartialOrd for Signature
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl SignatureEncoding for Signature
impl SignatureEncoding for Signature
source§impl Signer<Signature> for PrivateKey
impl Signer<Signature> for PrivateKey
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)