Enum signatory::ecdsa::PublicKey [−][src]
pub enum PublicKey<C: WeierstrassCurve> { Compressed(CompressedCurvePoint<C>), Uncompressed(UncompressedCurvePoint<C>), }
ECDSA public keys
Variants
Compressed(CompressedCurvePoint<C>)
Compressed Weierstrass elliptic curve point
Uncompressed(UncompressedCurvePoint<C>)
Uncompressed Weierstrass elliptic curve point
Methods
impl<C> PublicKey<C> where
C: WeierstrassCurve,
[src]
impl<C> PublicKey<C> where
C: WeierstrassCurve,
pub fn from_slice(slice: &[u8]) -> Result<Self, Error>
[src]
pub fn from_slice(slice: &[u8]) -> Result<Self, Error>
Create an ECDSA public key from an elliptic curve point
(compressed or uncompressed) encoded using the
Octet-String-to-Elliptic-Curve-Point
algorithm described in
SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.4 (page 11).
pub fn from_compressed_point<B>(into_bytes: B) -> Result<Self, Error> where
B: Into<GenericArray<u8, C::CompressedPointSize>>,
[src]
pub fn from_compressed_point<B>(into_bytes: B) -> Result<Self, Error> where
B: Into<GenericArray<u8, C::CompressedPointSize>>,
Create an ECDSA public key from an compressed elliptic curve point
encoded using the Octet-String-to-Elliptic-Curve-Point
algorithm
described in SEC 1: Elliptic Curve Cryptography (Version 2.0) section
2.3.4 (page 11).
pub fn from_untagged_point(
bytes: &GenericArray<u8, C::UntaggedPointSize>
) -> Self
[src]
pub fn from_untagged_point(
bytes: &GenericArray<u8, C::UntaggedPointSize>
) -> Self
Create an ECDSA 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
Octet-String-to-Elliptic-Curve-Point
encoding i.e
with the leading 0x04
byte in that encoding removed.
pub fn as_bytes(&self) -> &[u8]
[src]
pub fn as_bytes(&self) -> &[u8]
Obtain public key as a byte array reference
Trait Implementations
impl<C: Clone + WeierstrassCurve> Clone for PublicKey<C>
[src]
impl<C: Clone + WeierstrassCurve> Clone for PublicKey<C>
fn clone(&self) -> PublicKey<C>
[src]
fn clone(&self) -> PublicKey<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<C: PartialEq + WeierstrassCurve> PartialEq for PublicKey<C>
[src]
impl<C: PartialEq + WeierstrassCurve> PartialEq for PublicKey<C>
fn eq(&self, other: &PublicKey<C>) -> bool
[src]
fn eq(&self, other: &PublicKey<C>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &PublicKey<C>) -> bool
[src]
fn ne(&self, other: &PublicKey<C>) -> bool
This method tests for !=
.
impl<C: WeierstrassCurve> AsRef<[u8]> for PublicKey<C>
[src]
impl<C: WeierstrassCurve> AsRef<[u8]> for PublicKey<C>
impl<C: WeierstrassCurve> Debug for PublicKey<C>
[src]
impl<C: WeierstrassCurve> Debug for PublicKey<C>
Auto Trait Implementations
impl<C> Send for PublicKey<C> where
<<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Send,
<<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Send,
impl<C> Send for PublicKey<C> where
<<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Send,
<<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Send,
impl<C> Sync for PublicKey<C> where
<<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Sync,
<<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Sync,
impl<C> Sync for PublicKey<C> where
<<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Sync,
<<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Sync,