Struct compact_jwt::crypto::JwsEs256Signer
source · pub struct JwsEs256Signer { /* private fields */ }
Expand description
A JWS signer that creates ECDSA P-256 signatures.
Implementations§
source§impl JwsEs256Signer
impl JwsEs256Signer
sourcepub fn set_sign_option_embed_jwk(self, value: bool) -> Self
pub fn set_sign_option_embed_jwk(self, value: bool) -> Self
Enable or disable embedding of the public jwk into the Jws that are signed by this signer
sourcepub fn generate_es256() -> Result<Self, JwtError>
pub fn generate_es256() -> Result<Self, JwtError>
Create a new secure private key for signing
sourcepub fn from_es256_der(der: &[u8]) -> Result<Self, JwtError>
pub fn from_es256_der(der: &[u8]) -> Result<Self, JwtError>
Restore this JwsSigner from a DER private key.
sourcepub fn private_key_to_der(&self) -> Result<Vec<u8>, JwtError>
pub fn private_key_to_der(&self) -> Result<Vec<u8>, JwtError>
Export this signer to a DER private key.
sourcepub fn public_key_as_jwk(&self) -> Result<Jwk, JwtError>
pub fn public_key_as_jwk(&self) -> Result<Jwk, JwtError>
Get the public Jwk from this signer
sourcepub fn set_sign_option_legacy_kid(&self, value: bool) -> Self
pub fn set_sign_option_legacy_kid(&self, value: bool) -> Self
Enable use of the legacy KID for transitional purposes. This will be removed in a future version!
Trait Implementations§
source§impl Clone for JwsEs256Signer
impl Clone for JwsEs256Signer
source§fn clone(&self) -> JwsEs256Signer
fn clone(&self) -> JwsEs256Signer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for JwsEs256Signer
impl Debug for JwsEs256Signer
source§impl Hash for JwsEs256Signer
impl Hash for JwsEs256Signer
source§impl JwsSigner for JwsEs256Signer
impl JwsSigner for JwsEs256Signer
source§fn get_legacy_kid(&self) -> &str
fn get_legacy_kid(&self) -> &str
Get the legacy format key id from this signer. This value will be removed
in a future release.
source§fn update_header(&self, header: &mut ProtectedHeader) -> Result<(), JwtError>
fn update_header(&self, header: &mut ProtectedHeader) -> Result<(), JwtError>
Update thee content of the header with signer specific data
source§fn sign<V: JwsSignable>(&self, jws: &V) -> Result<V::Signed, JwtError>
fn sign<V: JwsSignable>(&self, jws: &V) -> Result<V::Signed, JwtError>
Perform the signature operation
source§fn set_sign_option_embed_kid(&self, value: bool) -> Self
fn set_sign_option_embed_kid(&self, value: bool) -> Self
Enable or disable embedding the KID in the Jws header
source§impl JwsSignerToVerifier for JwsEs256Signer
impl JwsSignerToVerifier for JwsEs256Signer
§type Verifier = JwsEs256Verifier
type Verifier = JwsEs256Verifier
The associated verifier
source§impl PartialEq for JwsEs256Signer
impl PartialEq for JwsEs256Signer
impl Eq for JwsEs256Signer
Auto Trait Implementations§
impl Freeze for JwsEs256Signer
impl RefUnwindSafe for JwsEs256Signer
impl Send for JwsEs256Signer
impl Sync for JwsEs256Signer
impl Unpin for JwsEs256Signer
impl UnwindSafe for JwsEs256Signer
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