pub struct Es256Signer { /* private fields */ }Expand description
A local ES256 signer: a P-256 SigningKey plus its key id.
Signing is deterministic (RFC 6979) and low-S normalized, so re-signing
the same Sig_structure yields byte-identical output: the profile’s
determinism guarantee holds for ES256 as it does for EdDSA.
Implementations§
Source§impl Es256Signer
impl Es256Signer
Sourcepub fn from_secret_bytes(
key_id: KeyId,
secret: &Zeroizing<[u8; 32]>,
) -> Result<Self, KeyError>
pub fn from_secret_bytes( key_id: KeyId, secret: &Zeroizing<[u8; 32]>, ) -> Result<Self, KeyError>
Build a signer from the 32 secret scalar bytes (big-endian).
§Errors
KeyError::InvalidPrivateKey if the bytes are not a valid non-zero
P-256 scalar.
Sourcepub fn public_key_sec1(&self) -> Vec<u8>
pub fn public_key_sec1(&self) -> Vec<u8>
The uncompressed SEC1 public key bytes (0x04 || X || Y, 65 bytes) for
this signer.
Trait Implementations§
Source§impl Signer for Es256Signer
impl Signer for Es256Signer
Auto Trait Implementations§
impl Freeze for Es256Signer
impl RefUnwindSafe for Es256Signer
impl Send for Es256Signer
impl Sync for Es256Signer
impl Unpin for Es256Signer
impl UnsafeUnpin for Es256Signer
impl UnwindSafe for Es256Signer
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