Enum ssh_key::public::EcdsaPublicKey
source · pub enum EcdsaPublicKey {
NistP256(EncodedPoint<U32>),
NistP384(EncodedPoint<U48>),
NistP521(EncodedPoint<U66>),
}
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§
source§impl 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] ⓘ
pub fn as_sec1_bytes(&self) -> &[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§
source§impl AsRef<[u8]> for EcdsaPublicKey
impl AsRef<[u8]> for EcdsaPublicKey
source§impl Clone for EcdsaPublicKey
impl Clone for EcdsaPublicKey
source§fn clone(&self) -> EcdsaPublicKey
fn clone(&self) -> EcdsaPublicKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EcdsaPublicKey
impl Debug for EcdsaPublicKey
source§impl Display for EcdsaPublicKey
impl Display for EcdsaPublicKey
source§impl From<&EcdsaKeypair> for EcdsaPublicKey
impl From<&EcdsaKeypair> for EcdsaPublicKey
source§fn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
Converts to this type from the input type.
source§impl From<EcdsaKeypair> for EcdsaPublicKey
impl From<EcdsaKeypair> for EcdsaPublicKey
source§fn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
Converts to this type from the input type.
source§impl From<EcdsaPublicKey> for KeyData
impl From<EcdsaPublicKey> for KeyData
source§fn from(public_key: EcdsaPublicKey) -> KeyData
fn from(public_key: EcdsaPublicKey) -> KeyData
Converts to this type from the input type.
source§impl From<EcdsaPublicKey> for PublicKey
impl From<EcdsaPublicKey> for PublicKey
source§fn from(public_key: EcdsaPublicKey) -> PublicKey
fn from(public_key: EcdsaPublicKey) -> PublicKey
Converts to this type from the input type.
source§impl LowerHex for EcdsaPublicKey
impl LowerHex for EcdsaPublicKey
source§impl Ord for EcdsaPublicKey
impl Ord for EcdsaPublicKey
source§fn cmp(&self, other: &EcdsaPublicKey) -> Ordering
fn cmp(&self, other: &EcdsaPublicKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for EcdsaPublicKey
impl PartialEq for EcdsaPublicKey
source§impl PartialOrd for EcdsaPublicKey
impl PartialOrd for EcdsaPublicKey
source§impl UpperHex for EcdsaPublicKey
impl UpperHex for EcdsaPublicKey
impl Copy for EcdsaPublicKey
impl Eq for EcdsaPublicKey
impl StructuralPartialEq for EcdsaPublicKey
Auto Trait Implementations§
impl Freeze for EcdsaPublicKey
impl RefUnwindSafe for EcdsaPublicKey
impl Send for EcdsaPublicKey
impl Sync for EcdsaPublicKey
impl Unpin for EcdsaPublicKey
impl UnwindSafe for EcdsaPublicKey
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)