[−][src]Enum signatory::EcdsaPublicKey
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]
C: WeierstrassCurve,
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B) -> Result<Self, Error>
[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).
pub fn from_compressed_point<B>(into_bytes: B) -> Result<Self, Error> where
B: Into<GenericArray<u8, C::CompressedPointSize>>,
[src]
B: Into<GenericArray<u8, C::CompressedPointSize>>,
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).
pub fn from_untagged_point(
bytes: &GenericArray<u8, C::UntaggedPointSize>
) -> Self
[src]
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
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]
C: WeierstrassCurve,
fn decode<E: Encoding>(
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
[src]
encoded_signature: &[u8],
encoding: &E
) -> Result<Self, Error>
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).
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
S: AsRef<str>,
E: Encoding,
Decode the given string-alike type with the provided Encoding
, returning the decoded value or a Error
. Read more
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
R: Read,
E: Encoding,
Decode the data read from the given io::Read
type with the provided Encoding
, returning the decoded value or a Error
. Read more
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
Read a file at the given path, decoding the data it contains using the provided Encoding
, returning the decoded value or a Error
. Read more
impl<C> Encode for PublicKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
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).
fn encode_to_string<E: Encoding>(&self, encoding: &E) -> Result<String, Error>
[src]
Encode self
to a String
using the provided Encoding
, returning the encoded value or a Error
. Read more
fn encode_to_writer<W, E>(
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
[src]
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
Encode self
with the given Encoding
, writing the result to the supplied io::Write
type, returning the number of bytes written or a Error
. Read more
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
P: AsRef<Path>,
E: Encoding,
Encode self
and write it to a file at the given path, returning the resulting File
or a Error
. Read more
impl<C: WeierstrassCurve> PublicKey for PublicKey<C>
[src]
impl<C: Clone + WeierstrassCurve> Clone for PublicKey<C>
[src]
fn clone(&self) -> PublicKey<C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C> Debug for PublicKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
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]
fn cmp(&self, other: &PublicKey<C>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<C: PartialOrd + WeierstrassCurve> PartialOrd<PublicKey<C>> for PublicKey<C>
[src]
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: Hash + WeierstrassCurve> Hash for PublicKey<C>
[src]
fn hash<__HC: Hasher>(&self, state: &mut __HC)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
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]
C: WeierstrassCurve,
<<C as WeierstrassCurve>::CompressedPointSize as ArrayLength<u8>>::ArrayType: Copy,
<<C as WeierstrassCurve>::UncompressedPointSize as ArrayLength<u8>>::ArrayType: Copy,
impl<C> AsRef<[u8]> for PublicKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
Auto Trait Implementations
impl<C> Send for PublicKey<C> where
<C as WeierstrassCurve>::CompressedPointSize: ArrayLength<u8>,
<C as WeierstrassCurve>::UncompressedPointSize: ArrayLength<u8>,
<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>,
<C as WeierstrassCurve>::CompressedPointSize: ArrayLength<u8>,
<C as WeierstrassCurve>::UncompressedPointSize: ArrayLength<u8>,
Blanket Implementations
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> Same<T> for T
type Output = T
Should always be Self