pub enum EcdsaKeypair {
NistP256 {
public: EncodedPoint<U32>,
private: EcdsaPrivateKey<32>,
},
NistP384 {
public: EncodedPoint<U48>,
private: EcdsaPrivateKey<48>,
},
NistP521 {
public: EncodedPoint<U66>,
private: EcdsaPrivateKey<66>,
},
}
Available on crate feature
ecdsa
only.Expand description
Elliptic Curve Digital Signature Algorithm (ECDSA) private/public keypair.
Variants§
NistP256
NIST P-256 ECDSA keypair.
NistP384
NIST P-384 ECDSA keypair.
NistP521
NIST P-521 ECDSA keypair.
Implementations§
source§impl EcdsaKeypair
impl EcdsaKeypair
sourcepub fn random(rng: &mut impl CryptoRngCore, curve: EcdsaCurve) -> Result<Self>
Available on crate feature rand_core
only.
pub fn random(rng: &mut impl CryptoRngCore, curve: EcdsaCurve) -> Result<Self>
rand_core
only.Generate a random ECDSA private key.
sourcepub fn curve(&self) -> EcdsaCurve
pub fn curve(&self) -> EcdsaCurve
Get the EcdsaCurve
for this key.
sourcepub fn public_key_bytes(&self) -> &[u8] ⓘ
pub fn public_key_bytes(&self) -> &[u8] ⓘ
Get the bytes representing the public key.
sourcepub fn private_key_bytes(&self) -> &[u8] ⓘ
pub fn private_key_bytes(&self) -> &[u8] ⓘ
Get the bytes representing the private key.
Trait Implementations§
source§impl Clone for EcdsaKeypair
impl Clone for EcdsaKeypair
source§fn clone(&self) -> EcdsaKeypair
fn clone(&self) -> EcdsaKeypair
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 ConstantTimeEq for EcdsaKeypair
impl ConstantTimeEq for EcdsaKeypair
source§impl Debug for EcdsaKeypair
impl Debug for EcdsaKeypair
source§impl Decode for EcdsaKeypair
impl Decode for EcdsaKeypair
source§impl Encode for EcdsaKeypair
impl Encode for EcdsaKeypair
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<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 KeypairData
impl From<EcdsaKeypair> for KeypairData
source§fn from(keypair: EcdsaKeypair) -> KeypairData
fn from(keypair: EcdsaKeypair) -> KeypairData
Converts to this type from the input type.
source§impl From<EcdsaKeypair> for PrivateKey
impl From<EcdsaKeypair> for PrivateKey
source§fn from(keypair: EcdsaKeypair) -> PrivateKey
fn from(keypair: EcdsaKeypair) -> PrivateKey
Converts to this type from the input type.
source§impl PartialEq for EcdsaKeypair
impl PartialEq for EcdsaKeypair
source§impl Signer<Signature> for EcdsaKeypair
Available on crate feature alloc
and (crate features p256
or p384
or p521
) only.
impl Signer<Signature> for EcdsaKeypair
Available on crate feature
alloc
and (crate features p256
or p384
or p521
) only.impl Eq for EcdsaKeypair
Auto Trait Implementations§
impl Freeze for EcdsaKeypair
impl RefUnwindSafe for EcdsaKeypair
impl Send for EcdsaKeypair
impl Sync for EcdsaKeypair
impl Unpin for EcdsaKeypair
impl UnwindSafe for EcdsaKeypair
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
)