pub fn from_der(input: impl AsRef<[u8]>) -> Result<Self, JoseError> {
        (|| -> anyhow::Result<Self> {
            let (pkcs8_der, curve) = match Self::detect_pkcs8(input.as_ref(), false) {
                Some(val) => (input.as_ref(), val),
                None => bail!("The EdDSA private key must be wrapped by PKCS#8 format."),
            };

            let private_key = PKey::private_key_from_der(pkcs8_der)?;

            Ok(Self {
                private_key,
                curve,
                algorithm: None,
                key_id: None,
            })
        })()
        .map_err(|err| match err.downcast::<JoseError>() {
            Ok(err) => err,
            Err(err) => JoseError::InvalidKeyFormat(err),
        })
    }
/// Create a EdDSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo.
///
/// # Arguments
/// * `input` - A private key that is a DER encoded PKCS#8 PrivateKeyInfo.
Create a EdDSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo.
Create a EdDSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo .
pub fn from_der(input: impl AsRef<[u8]>) -> Result<Self, JoseError> {
        (|| -> anyhow::Result<Self> {
            let (pkcs8_der, curve) = match Self::detect_pkcs8(input.as_ref(), false) {
                Some(val) => (input.as_ref(), val),
                None => bail!("The EdDSA private key must be wrapped by PKCS#8 format."),
            };
            let private_key = PKey::private_key_from_der(pkcs8_der)?;
            Ok(Self {
                private_key,
                curve,
                algorithm: None,
                key_id: None,
            })
        })()
        .map_err(|err| match err.downcast::<JoseError>() {
            Ok(err) => err,
            Err(err) => JoseError::InvalidKeyFormat(err),
        })
    }
pub fn from_der ( input : impl AsRef < [ u8 ] > ) -> Result < Self , JoseError > { ( | | -> anyhow :: Result < Self > { let ( pkcs8_der , curve ) = match Self :: detect_pkcs8 ( input . as_ref ( ) , false ) { Some ( val ) => ( input . as_ref ( ) , val ) , None => bail ! ( " " ) , } ; let private_key = PKey :: private_key_from_der ( pkcs8_der ) ? ; Ok ( Self { private_key , curve , algorithm : None , key_id : None , } ) } ) ( ) . map_err ( | err | match err . downcast :: < JoseError > ( ) { Ok ( err ) => err , Err ( err ) => JoseError :: InvalidKeyFormat ( err ) , } ) }
Create a EdDSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo.
Create a EdDSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo .
input
impl AsRef<[u8]>
input
impl AsRef<[u8]>