fn secret_key_bytes(key_part: &ASN1Block) -> Result<Vec<u8>, KeyDerParsingError> {
        if let ASN1Block::OctetString(_offset, key_bytes_string) = key_part {
            let key_bytes_block = simple_asn1::from_der(key_bytes_string).map_err(|e| {
                Self::parsing_error(&*format!("Error in DER encoding: {}", e.to_string()))
            })?;
            if key_bytes_block.len() != 1 {
                return Err(Self::parsing_error("Expected single block"));
            }
            if let ASN1Block::OctetString(_offset, key_bytes) = &key_bytes_block[0] {
                return Ok(key_bytes.clone());
            }
        }
        Err(Self::parsing_error("Expected octet string."))
    }
/// Retrieves raw secret key bytes from the given ASN1Block.
Retrieves raw secret key bytes from the given ASN1Block.
Retrieves raw secret key bytes from the given ASN1Block .
fn secret_key_bytes(key_part: &ASN1Block) -> Result<Vec<u8>, KeyDerParsingError> {
        if let ASN1Block::OctetString(_offset, key_bytes_string) = key_part {
            let key_bytes_block = simple_asn1::from_der(key_bytes_string).map_err(|e| {
                Self::parsing_error(&*format!("Error in DER encoding: {}", e.to_string()))
            })?;
            if key_bytes_block.len() != 1 {
                return Err(Self::parsing_error("Expected single block"));
            }
            if let ASN1Block::OctetString(_offset, key_bytes) = &key_bytes_block[0] {
                return Ok(key_bytes.clone());
            }
        }
        Err(Self::parsing_error("Expected octet string."))
    }
fn secret_key_bytes ( key_part : & ASN1Block ) -> Result < Vec < u8 > , KeyDerParsingError > { if let ASN1Block :: OctetString ( _offset , key_bytes_string ) = key_part { let key_bytes_block = simple_asn1 :: from_der ( key_bytes_string ) . map_err ( | e | { Self :: parsing_error ( & * format ! ( " " e to_string ( ) ) ) } ) ? ; if key_bytes_block . len ( ) != 1 { return Err ( Self :: parsing_error ( " " ) ) ; } if let ASN1Block :: OctetString ( _offset , key_bytes ) = & key_bytes_block [ 0 ] { return Ok ( key_bytes . clone ( ) ) ; } } Err ( Self :: parsing_error ( " " ) ) }
Retrieves raw secret key bytes from the given ASN1Block.
Retrieves raw secret key bytes from the given ASN1Block .
key_part
&ASN1Block
key_part
&ASN1Block