pub struct Ps256Signer { /* private fields */ }Available on crate features
signatures and signatures-rsa only.Expand description
RSA-PSS signer (PS256).
Implementations§
Source§impl Ps256Signer
impl Ps256Signer
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, bits: usize) -> Result<(Self, String)>
pub fn generate(signer_info: SignerInfo, bits: usize) -> Result<(Self, String)>
Generate a new random signing key with the specified bit size.
Common sizes are 2048, 3072, or 4096 bits. Returns the signer and the public key in PEM format.
§Errors
Returns an error if key generation fails.
Sourcepub fn generate_2048(signer_info: SignerInfo) -> Result<(Self, String)>
pub fn generate_2048(signer_info: SignerInfo) -> Result<(Self, String)>
Generate a new random signing key with 2048 bits (recommended minimum).
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 Ps256Signer
impl Signer for Ps256Signer
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 Ps256Signer
impl RefUnwindSafe for Ps256Signer
impl Send for Ps256Signer
impl Sync for Ps256Signer
impl Unpin for Ps256Signer
impl UnsafeUnpin for Ps256Signer
impl UnwindSafe for Ps256Signer
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