pub struct EcdsaSigner { /* private fields */ }Available on crate feature
signatures only.Expand description
ECDSA P-256 signer (ES256).
Implementations§
Source§impl EcdsaSigner
impl EcdsaSigner
Sourcepub fn from_pem(pem: &str, signer_info: SignerInfo) -> Result<Self>
pub fn from_pem(pem: &str, signer_info: SignerInfo) -> Result<Self>
Create a new signer from a PEM-encoded private key.
§Errors
Returns an error if the PEM cannot be parsed.
Sourcepub fn generate(signer_info: SignerInfo) -> Result<(Self, String)>
pub fn generate(signer_info: SignerInfo) -> Result<(Self, String)>
Generate a new random signing key.
Returns the signer and the public key in PEM format.
§Errors
Returns an error if key generation fails.
Sourcepub fn public_key_pem(&self) -> Result<String>
pub fn public_key_pem(&self) -> Result<String>
Trait Implementations§
Source§impl Signer for EcdsaSigner
impl Signer for EcdsaSigner
Source§fn algorithm(&self) -> SignatureAlgorithm
fn algorithm(&self) -> SignatureAlgorithm
Get the signature algorithm used by this signer.
Source§fn signer_info(&self) -> SignerInfo
fn signer_info(&self) -> SignerInfo
Get information about the signer.
Auto Trait Implementations§
impl Freeze for EcdsaSigner
impl RefUnwindSafe for EcdsaSigner
impl Send for EcdsaSigner
impl Sync for EcdsaSigner
impl Unpin for EcdsaSigner
impl UnsafeUnpin for EcdsaSigner
impl UnwindSafe for EcdsaSigner
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