[−][src]Enum ecdsa::PublicKey
Public keys for Weierstrass curves
Variants
Compressed(CompressedPoint<C>)
Compressed Weierstrass elliptic curve point
Uncompressed(UncompressedPoint<C>)
Uncompressed Weierstrass elliptic curve point
Implementations
impl<C> PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Option<PublicKey<C>>
[src]
Decode public key from an elliptic curve point
(compressed or uncompressed) encoded using the
Elliptic-Curve-Point-to-Octet-String
algorithm described in
SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.3 (page 10).
pub fn from_untagged_point(
bytes: &GenericArray<u8, <<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output>
) -> PublicKey<C> where
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: ArrayLength<u8>,
[src]
bytes: &GenericArray<u8, <<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output>
) -> PublicKey<C> where
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: ArrayLength<u8>,
Decode public key from a raw uncompressed point serialized
as a bytestring, without a 0x04
-byte tag.
This will be twice the modulus size, or 1-byte smaller than the
Elliptic-Curve-Point-to-Octet-String
encoding i.e
with the leading 0x04
byte in that encoding removed.
pub fn compress(&mut self)
[src]
Compress this PublicKey
.
If the key is already compressed, this is a no-op.
pub fn as_bytes(&self) -> &[u8]
[src]
Obtain public key as a byte array reference
impl<C> PublicKey<C> where
C: Curve + Arithmetic,
<C as Arithmetic>::AffinePoint: Mul<NonZeroScalar<C>>,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
CompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
UncompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<C as Arithmetic>::AffinePoint as Mul<NonZeroScalar<C>>>::Output == <C as Arithmetic>::AffinePoint,
[src]
C: Curve + Arithmetic,
<C as Arithmetic>::AffinePoint: Mul<NonZeroScalar<C>>,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
CompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
UncompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<C as Arithmetic>::AffinePoint as Mul<NonZeroScalar<C>>>::Output == <C as Arithmetic>::AffinePoint,
pub fn from_secret_key(
secret_key: &SecretKey<C>,
compress: bool
) -> Result<PublicKey<C>, Error>
[src]
secret_key: &SecretKey<C>,
compress: bool
) -> Result<PublicKey<C>, Error>
Trait Implementations
impl<C> AsRef<[u8]> for PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
impl<C> Clone for PublicKey<C> where
C: Clone + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Clone + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
impl<C> Copy for PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Copy,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Copy,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Copy,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Copy,
impl<C> Debug for PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
impl<C> Eq for PublicKey<C> where
C: Eq + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Eq + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
impl<C> From<CompressedPoint<C>> for PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
fn from(point: CompressedPoint<C>) -> PublicKey<C>
[src]
impl<C> From<UncompressedPoint<C>> for PublicKey<C> where
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
fn from(point: UncompressedPoint<C>) -> PublicKey<C>
[src]
impl<C> Ord for PublicKey<C> where
C: Ord + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: Ord + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
fn cmp(&self, other: &PublicKey<C>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<C> PartialEq<PublicKey<C>> for PublicKey<C> where
C: PartialEq<C> + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: PartialEq<C> + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
impl<C> PartialOrd<PublicKey<C>> for PublicKey<C> where
C: PartialOrd<C> + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
[src]
C: PartialOrd<C> + Curve,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
fn partial_cmp(&self, other: &PublicKey<C>) -> Option<Ordering>
[src]
fn lt(&self, other: &PublicKey<C>) -> bool
[src]
fn le(&self, other: &PublicKey<C>) -> bool
[src]
fn gt(&self, other: &PublicKey<C>) -> bool
[src]
fn ge(&self, other: &PublicKey<C>) -> bool
[src]
impl<'_, C> TryFrom<&'_ SecretKey<C>> for PublicKey<C> where
C: Curve + Arithmetic,
<C as Arithmetic>::AffinePoint: Mul<NonZeroScalar<C>>,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
CompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
UncompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<C as Arithmetic>::AffinePoint as Mul<NonZeroScalar<C>>>::Output == <C as Arithmetic>::AffinePoint,
[src]
C: Curve + Arithmetic,
<C as Arithmetic>::AffinePoint: Mul<NonZeroScalar<C>>,
<C as Curve>::ElementSize: Add<UInt<UTerm, B1>>,
<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output: Add<UInt<UTerm, B1>>,
CompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
UncompressedPoint<C>: From<<C as Arithmetic>::AffinePoint>,
<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output: ArrayLength<u8>,
<<C as Arithmetic>::AffinePoint as Mul<NonZeroScalar<C>>>::Output == <C as Arithmetic>::AffinePoint,
Auto Trait Implementations
impl<C> RefUnwindSafe for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Send for PublicKey<C> where
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Sync for PublicKey<C> where
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> Unpin for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: Unpin,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
impl<C> UnwindSafe for PublicKey<C> where
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
<<<C as Curve>::ElementSize as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<<<C as Curve>::ElementSize as Add<<C as Curve>::ElementSize>>::Output as Add<UInt<UTerm, B1>>>::Output as ArrayLength<u8>>::ArrayType: UnwindSafe,
<C as Curve>::ElementSize: Add<<C as Curve>::ElementSize>,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,