Enum ssh_key::public::EcdsaPublicKey
source · [−]pub enum EcdsaPublicKey {
NistP256(EncodedPoint<U32>),
NistP384(EncodedPoint<U48>),
NistP521(EncodedPoint<U66>),
}ecdsa only.Expand description
Elliptic Curve Digital Signature Algorithm (ECDSA) public key.
Public keys are represented as sec1::EncodedPoint and require the
sec1 feature of this crate is enabled (which it is by default).
Described in FIPS 186-4.
Variants
NistP256(EncodedPoint<U32>)
NIST P-256 ECDSA public key.
NistP384(EncodedPoint<U48>)
NIST P-384 ECDSA public key.
NistP521(EncodedPoint<U66>)
NIST P-521 ECDSA public key.
Implementations
sourceimpl EcdsaPublicKey
impl EcdsaPublicKey
sourcepub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_sec1_bytes(bytes: &[u8]) -> Result<Self>
Parse an ECDSA public key from a SEC1-encoded point.
Determines the key type from the SEC1 tag byte and length.
sourcepub fn as_sec1_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn as_sec1_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Borrow the SEC1-encoded key data as bytes.
sourcepub fn curve(&self) -> EcdsaCurve
pub fn curve(&self) -> EcdsaCurve
Get the EcdsaCurve for this key.
Trait Implementations
sourceimpl Clone for EcdsaPublicKey
impl Clone for EcdsaPublicKey
sourcefn clone(&self) -> EcdsaPublicKey
fn clone(&self) -> EcdsaPublicKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for EcdsaPublicKey
impl Debug for EcdsaPublicKey
sourceimpl Display for EcdsaPublicKey
impl Display for EcdsaPublicKey
sourceimpl From<&'_ EcdsaKeypair> for EcdsaPublicKey
impl From<&'_ EcdsaKeypair> for EcdsaPublicKey
sourcefn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
Performs the conversion.
sourceimpl From<EcdsaKeypair> for EcdsaPublicKey
impl From<EcdsaKeypair> for EcdsaPublicKey
sourcefn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
Performs the conversion.
sourceimpl LowerHex for EcdsaPublicKey
impl LowerHex for EcdsaPublicKey
sourceimpl Ord for EcdsaPublicKey
impl Ord for EcdsaPublicKey
sourceimpl PartialEq<EcdsaPublicKey> for EcdsaPublicKey
impl PartialEq<EcdsaPublicKey> for EcdsaPublicKey
sourcefn eq(&self, other: &EcdsaPublicKey) -> bool
fn eq(&self, other: &EcdsaPublicKey) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &EcdsaPublicKey) -> bool
fn ne(&self, other: &EcdsaPublicKey) -> bool
This method tests for !=.
sourceimpl PartialOrd<EcdsaPublicKey> for EcdsaPublicKey
impl PartialOrd<EcdsaPublicKey> for EcdsaPublicKey
sourcefn partial_cmp(&self, other: &EcdsaPublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &EcdsaPublicKey) -> 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 UpperHex for EcdsaPublicKey
impl UpperHex for EcdsaPublicKey
impl Copy for EcdsaPublicKey
impl Eq for EcdsaPublicKey
impl StructuralEq for EcdsaPublicKey
impl StructuralPartialEq for EcdsaPublicKey
Auto Trait Implementations
impl RefUnwindSafe for EcdsaPublicKey
impl Send for EcdsaPublicKey
impl Sync for EcdsaPublicKey
impl Unpin for EcdsaPublicKey
impl UnwindSafe for EcdsaPublicKey
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