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, Error>
fn encoded_len_prefixed(&self) -> Result<usize, 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<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), 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<&VerifyingKey> for EcdsaPublicKey
Available on crate feature p521
only.
impl From<&VerifyingKey> for EcdsaPublicKey
Available on crate feature
p521
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 From<VerifyingKey> for EcdsaPublicKey
Available on crate feature p521
only.
impl From<VerifyingKey> for EcdsaPublicKey
Available on crate feature
p521
only.source§fn from(key: VerifyingKey) -> EcdsaPublicKey
fn from(key: VerifyingKey) -> EcdsaPublicKey
Converts to this type from the input type.
source§impl Hash for EcdsaPublicKey
impl Hash for EcdsaPublicKey
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 TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature p521
only.
impl TryFrom<&EcdsaPublicKey> for VerifyingKey
Available on crate feature
p521
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(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 p521
only.
impl TryFrom<EcdsaPublicKey> for VerifyingKey
Available on crate feature
p521
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 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 feature alloc
and (crate features p256
or p384
or p521
) only.
impl Verifier<Signature> for EcdsaPublicKey
Available on crate feature
alloc
and (crate features p256
or p384
or p521
) only.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§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
)