pub fn key_pair_from_pem(&self, input: impl AsRef<[u8]>) -> Result<RsaPssKeyPair, JoseError> {
        (|| -> anyhow::Result<RsaPssKeyPair> {
            let mut key_pair = RsaPssKeyPair::from_pem(
                input.as_ref(),
                Some(self.hash_algorithm()),
                Some(self.hash_algorithm()),
                Some(self.salt_len()),
            )?;

            if key_pair.key_len() * 8 < 2048 {
                bail!("key length must be 2048 or more.");
            }

            key_pair.set_algorithm(Some(self.name()));
            Ok(key_pair)
        })()
        .map_err(|err| match err.downcast::<JoseError>() {
            Ok(err) => err,
            Err(err) => JoseError::InvalidKeyFormat(err),
        })
    }
/// Create a RSA-PSS key pair from a private key of common or traditinal PEM format.
///
/// Common PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo
/// that surrounded by "-----BEGIN/END PRIVATE KEY----".
///
/// Traditional PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo or PKCS#1 RSAPrivateKey
/// that surrounded by "-----BEGIN/END RSA-PSS/RSA PRIVATE KEY----".
///
/// # Arguments
/// * `input` - A private key of common or traditinal PEM format.
Create a RSA-PSS key pair from a private key of common or traditinal PEM format.
Common PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo
that surrounded by "BEGIN/END PRIVATE KEY----".


Create a RSA - PSS key pair from a private key of common or traditinal PEM format . Common PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo that surrounded by " BEGIN / END PRIVATE KEY ---- " .
pub fn key_pair_from_pem(&self, input: impl AsRef<[u8]>) -> Result<RsaPssKeyPair, JoseError> {
        (|| -> anyhow::Result<RsaPssKeyPair> {
            let mut key_pair = RsaPssKeyPair::from_pem(
                input.as_ref(),
                Some(self.hash_algorithm()),
                Some(self.hash_algorithm()),
                Some(self.salt_len()),
            )?;
            if key_pair.key_len() * 8 < 2048 {
                bail!("key length must be 2048 or more.");
            }
            key_pair.set_algorithm(Some(self.name()));
            Ok(key_pair)
        })()
        .map_err(|err| match err.downcast::<JoseError>() {
            Ok(err) => err,
            Err(err) => JoseError::InvalidKeyFormat(err),
        })
    }
pub fn key_pair_from_pem ( & self , input : impl AsRef < [ u8 ] > ) -> Result < RsaPssKeyPair , JoseError > { ( | | -> anyhow :: Result < RsaPssKeyPair > { let mut key_pair = RsaPssKeyPair :: from_pem ( input . as_ref ( ) , Some ( self . hash_algorithm ( ) ) , Some ( self . hash_algorithm ( ) ) , Some ( self . salt_len ( ) ) , ) ? ; if key_pair . key_len ( ) * 8 < 2048 { bail ! ( " " ) ; } key_pair . set_algorithm ( Some ( self . name ( ) ) ) ; Ok ( key_pair ) } ) ( ) . map_err ( | err | match err . downcast :: < JoseError > ( ) { Ok ( err ) => err , Err ( err ) => JoseError :: InvalidKeyFormat ( err ) , } ) }
Create a RSA-PSS key pair from a private key of common or traditinal PEM format.
Create a RSA - PSS key pair from a private key of common or traditinal PEM format .
&self
input
impl AsRef<[u8]>
&self
input
impl AsRef<[u8]>