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§
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>
Source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
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 From<&EcdsaKeypair> for EcdsaPublicKey
impl From<&EcdsaKeypair> for EcdsaPublicKey
Source§fn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: &EcdsaKeypair) -> EcdsaPublicKey
Source§impl From<EcdsaKeypair> for EcdsaPublicKey
impl From<EcdsaKeypair> for EcdsaPublicKey
Source§fn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
fn from(keypair: EcdsaKeypair) -> EcdsaPublicKey
Source§impl From<EcdsaPublicKey> for KeyData
impl From<EcdsaPublicKey> for KeyData
Source§fn from(public_key: EcdsaPublicKey) -> KeyData
fn from(public_key: EcdsaPublicKey) -> KeyData
Source§impl From<EcdsaPublicKey> for PublicKey
impl From<EcdsaPublicKey> for PublicKey
Source§fn from(public_key: EcdsaPublicKey) -> PublicKey
fn from(public_key: EcdsaPublicKey) -> PublicKey
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,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 134 bytes
Size for each variant:
NistP256
: 65 bytesNistP384
: 97 bytesNistP521
: 133 bytes