pub fn verifier_from_der(
        &self,
        input: impl AsRef<[u8]>,
    ) -> Result<RsassaJwsVerifier, JoseError> {
        (|| -> anyhow::Result<RsassaJwsVerifier> {
            let spki_der_vec;
            let spki_der = match RsaKeyPair::detect_pkcs8(input.as_ref(), true) {
                Some(_) => input.as_ref(),
                None => {
                    spki_der_vec = RsaKeyPair::to_pkcs8(input.as_ref(), true);
                    spki_der_vec.as_slice()
                }
            };

            let public_key = PKey::public_key_from_der(spki_der)?;

            let rsa = public_key.rsa()?;
            if rsa.size() * 8 < 2048 {
                bail!("key length must be 2048 or more.");
            }

            Ok(RsassaJwsVerifier {
                algorithm: self.clone(),
                public_key,
                key_id: None,
            })
        })()
        .map_err(|err| JoseError::InvalidKeyFormat(err))
    }
/// Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
///
/// # Arguments
/// * `input` - A public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey .
pub fn verifier_from_der(
        &self,
        input: impl AsRef<[u8]>,
    ) -> Result<RsassaJwsVerifier, JoseError> {
        (|| -> anyhow::Result<RsassaJwsVerifier> {
            let spki_der_vec;
            let spki_der = match RsaKeyPair::detect_pkcs8(input.as_ref(), true) {
                Some(_) => input.as_ref(),
                None => {
                    spki_der_vec = RsaKeyPair::to_pkcs8(input.as_ref(), true);
                    spki_der_vec.as_slice()
                }
            };
            let public_key = PKey::public_key_from_der(spki_der)?;
            let rsa = public_key.rsa()?;
            if rsa.size() * 8 < 2048 {
                bail!("key length must be 2048 or more.");
            }
            Ok(RsassaJwsVerifier {
                algorithm: self.clone(),
                public_key,
                key_id: None,
            })
        })()
        .map_err(|err| JoseError::InvalidKeyFormat(err))
    }
pub fn verifier_from_der ( & self , input : impl AsRef < [ u8 ] > , ) -> Result < RsassaJwsVerifier , JoseError > { ( | | -> anyhow :: Result < RsassaJwsVerifier > { let spki_der_vec ; let spki_der = match RsaKeyPair :: detect_pkcs8 ( input . as_ref ( ) , true ) { Some ( _ ) => input . as_ref ( ) , None => { spki_der_vec = RsaKeyPair :: to_pkcs8 ( input . as_ref ( ) , true ) ; spki_der_vec . as_slice ( ) } } ; let public_key = PKey :: public_key_from_der ( spki_der ) ? ; let rsa = public_key . rsa ( ) ? ; if rsa . size ( ) * 8 < 2048 { bail ! ( " " ) ; } Ok ( RsassaJwsVerifier { algorithm : self . clone ( ) , public_key , key_id : None , } ) } ) ( ) . map_err ( | err | JoseError :: InvalidKeyFormat ( err ) ) }
Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey .
&self
input
impl AsRef<[u8]>
&self
input
impl AsRef<[u8]>