Enum ssh_key::public::EcdsaPublicKey
source · pub enum EcdsaPublicKey {
NistP256(EncodedPoint<U32>),
NistP384(EncodedPoint<U48>),
NistP521(EncodedPoint<U66>),
}Available on crate feature
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§
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 Decode for EcdsaPublicKey
impl Decode for EcdsaPublicKey
source§impl Display for EcdsaPublicKey
impl Display for EcdsaPublicKey
source§impl Encode for EcdsaPublicKey
impl Encode for EcdsaPublicKey
source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Get the length of this type encoded in bytes, prior to Base64 encoding.
source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Encode this value using the provided
Writer.source§fn encoded_len_prefixed(&self) -> Result<usize, Self::Error>
fn encoded_len_prefixed(&self) -> Result<usize, Self::Error>
Return the length of this type after encoding when prepended with a
uint32 length prefix.source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Self::Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Self::Error>
Encode this value, first prepending a
uint32 length prefix
set to Encode::encoded_len.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<&VerifyingKey<NistP256>> for EcdsaPublicKey
Available on crate feature p256 only.
impl From<&VerifyingKey<NistP256>> for EcdsaPublicKey
Available on crate feature
p256 only.source§fn from(key: &VerifyingKey) -> EcdsaPublicKey
fn from(key: &VerifyingKey) -> EcdsaPublicKey
Converts to this type from the input type.
source§impl From<&VerifyingKey<NistP384>> for EcdsaPublicKey
Available on crate feature p384 only.
impl From<&VerifyingKey<NistP384>> for EcdsaPublicKey
Available on crate feature
p384 only.source§fn from(key: &VerifyingKey) -> EcdsaPublicKey
fn from(key: &VerifyingKey) -> 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 From<VerifyingKey<NistP256>> for EcdsaPublicKey
Available on crate feature p256 only.
impl From<VerifyingKey<NistP256>> for EcdsaPublicKey
Available on crate feature
p256 only.source§fn from(key: VerifyingKey) -> EcdsaPublicKey
fn from(key: VerifyingKey) -> EcdsaPublicKey
Converts to this type from the input type.
source§impl From<VerifyingKey<NistP384>> for EcdsaPublicKey
Available on crate feature p384 only.
impl From<VerifyingKey<NistP384>> for EcdsaPublicKey
Available on crate feature
p384 only.source§fn from(key: VerifyingKey) -> EcdsaPublicKey
fn from(key: VerifyingKey) -> EcdsaPublicKey
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<EcdsaPublicKey> for EcdsaPublicKey
impl PartialEq<EcdsaPublicKey> for EcdsaPublicKey
source§fn 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 ==.source§impl PartialOrd<EcdsaPublicKey> for EcdsaPublicKey
impl PartialOrd<EcdsaPublicKey> for EcdsaPublicKey
source§fn partial_cmp(&self, other: &EcdsaPublicKey) -> Option<Ordering>
fn partial_cmp(&self, other: &EcdsaPublicKey) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature p256 only.
impl TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature
p256 only.source§fn try_from(public_key: &EcdsaPublicKey) -> Result<VerifyingKey>
fn try_from(public_key: &EcdsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
source§impl TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature p384 only.
impl TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature
p384 only.source§fn try_from(public_key: &EcdsaPublicKey) -> Result<VerifyingKey>
fn try_from(public_key: &EcdsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
source§impl TryFrom<EcdsaPublicKey> for VerifyingKey
Available on crate feature p256 only.
impl TryFrom<EcdsaPublicKey> for VerifyingKey
Available on crate feature
p256 only.source§fn try_from(key: EcdsaPublicKey) -> Result<VerifyingKey>
fn try_from(key: EcdsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
source§impl TryFrom<EcdsaPublicKey> for VerifyingKey
Available on crate feature p384 only.
impl TryFrom<EcdsaPublicKey> for VerifyingKey
Available on crate feature
p384 only.source§fn try_from(key: EcdsaPublicKey) -> Result<VerifyingKey>
fn try_from(key: EcdsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
source§impl UpperHex for EcdsaPublicKey
impl UpperHex for EcdsaPublicKey
source§impl Verifier<Signature> for EcdsaPublicKey
Available on crate features p256 or p384 only.
impl Verifier<Signature> for EcdsaPublicKey
Available on crate features
p256 or p384 only.