[][src]Enum signatory::ecdsa::PublicKey

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]

pub fn from_bytes<B: AsRef<[u8]>>(bytes: B) -> Option<Self>[src]

Create an ECDSA 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).

http://www.secg.org/sec1-v2.pdf

pub fn from_compressed_point<B>(into_bytes: B) -> Option<Self> where
    B: Into<GenericArray<u8, C::CompressedPointSize>>, 
[src]

Create an ECDSA public key from an compressed elliptic curve point 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).

http://www.secg.org/sec1-v2.pdf

pub fn from_untagged_point(
    bytes: &GenericArray<u8, C::UntaggedPointSize>
) -> Self
[src]

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 Elliptic-Curve-Point-to-Octet-String encoding i.e with the leading 0x04 byte in that encoding removed.

pub fn as_bytes(&self) -> &[u8][src]

Obtain public key as a byte array reference

Trait Implementations

impl<C> Decode for PublicKey<C> where
    C: WeierstrassCurve
[src]

fn decode<E: Encoding>(
    encoded_signature: &[u8],
    encoding: &E
) -> Result<Self, Error>
[src]

Decode an ECDSA public key from an elliptic curve point (compressed or uncompressed) encoded using given Encoding with the underlying bytes serialized 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).

http://www.secg.org/sec1-v2.pdf

impl<C> Encode for PublicKey<C> where
    C: WeierstrassCurve
[src]

fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>[src]

Encode this ECDSA public key (compressed or uncompressed) encoded using given Encoding with the underlying bytes serialized 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).

http://www.secg.org/sec1-v2.pdf

impl<C: WeierstrassCurve> PublicKey for PublicKey<C>[src]

impl<C> Debug for PublicKey<C> where
    C: WeierstrassCurve
[src]

impl<C: PartialEq + WeierstrassCurve> PartialEq<PublicKey<C>> for PublicKey<C>[src]

impl<C: Eq + WeierstrassCurve> Eq for PublicKey<C>[src]

impl<C: Ord + WeierstrassCurve> Ord for PublicKey<C>[src]

impl<C: PartialOrd + WeierstrassCurve> PartialOrd<PublicKey<C>> for PublicKey<C>[src]

impl<C: Hash + WeierstrassCurve> Hash for PublicKey<C>[src]

impl<C> Copy for PublicKey<C> where
    C: WeierstrassCurve,
    <<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Copy,
    <<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Copy
[src]

impl<C> AsRef<[u8]> for PublicKey<C> where
    C: WeierstrassCurve
[src]

impl<C: Clone + WeierstrassCurve> Clone for PublicKey<C>[src]

Auto Trait Implementations

impl<C> Unpin for PublicKey<C> where
    <<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Unpin,
    <<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Unpin

impl<C> Send for PublicKey<C> where
    <C as WeierstrassCurve>::CompressedPointSize: ArrayLength<u8>,
    <C as WeierstrassCurve>::UncompressedPointSize: ArrayLength<u8>, 

impl<C> Sync for PublicKey<C> where
    <C as WeierstrassCurve>::CompressedPointSize: ArrayLength<u8>,
    <C as WeierstrassCurve>::UncompressedPointSize: ArrayLength<u8>, 

impl<C> UnwindSafe for PublicKey<C> where
    <<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
    <<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: UnwindSafe

impl<C> RefUnwindSafe for PublicKey<C> where
    <<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
    <<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> Same<T> for T

type Output = T

Should always be Self