pub struct PublicKey<C: Curve> { /* private fields */ }Expand description
An ECDSA public key over the given curve.
Implementations§
Source§impl<C: Curve> PublicKey<C>
impl<C: Curve> PublicKey<C>
Sourcepub fn from_x962_uncompressed(x962: &[u8]) -> Option<Self>
pub fn from_x962_uncompressed(x962: &[u8]) -> Option<Self>
Parse a public key in uncompressed X9.62 format. (This is the common format for elliptic curve points beginning with an 0x04 byte.)
Sourcepub fn to_x962_uncompressed(&self) -> Buffer
pub fn to_x962_uncompressed(&self) -> Buffer
Serialize this key as uncompressed X9.62 format.
Sourcepub fn from_der_subject_public_key_info(spki: &[u8]) -> Option<Self>
pub fn from_der_subject_public_key_info(spki: &[u8]) -> Option<Self>
Parse a public key in SubjectPublicKeyInfo format. (This is found in, e.g., X.509 certificates.)
Sourcepub fn to_der_subject_public_key_info(&self) -> Buffer
pub fn to_der_subject_public_key_info(&self) -> Buffer
Serialize this key in SubjectPublicKeyInfo format.
Sourcepub fn verify(
&self,
signed_msg: &[u8],
signature: &[u8],
) -> Result<(), InvalidSignatureError>
pub fn verify( &self, signed_msg: &[u8], signature: &[u8], ) -> Result<(), InvalidSignatureError>
Verify signature as a valid signature of a digest of signed_msg
with this public key. SHA-256 will be used to produce the digest if the
curve of this public key is P-256. SHA-384 will be used to produce the
digest if the curve of this public key is P-384.
Auto Trait Implementations§
impl<C> Freeze for PublicKey<C>
impl<C> RefUnwindSafe for PublicKey<C>where
C: RefUnwindSafe,
impl<C> Send for PublicKey<C>where
C: Send,
impl<C> Sync for PublicKey<C>where
C: Sync,
impl<C> Unpin for PublicKey<C>where
C: Unpin,
impl<C> UnsafeUnpin for PublicKey<C>
impl<C> UnwindSafe for PublicKey<C>where
C: UnwindSafe,
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