feat: v0.10.4, add feature with-sequoia-openpgp

This commit is contained in:
2024-09-07 19:32:26 +08:00
parent 8ec07eb01a
commit a61782e3fe
4 changed files with 30 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ use openssl::bn::BigNum;
use openssl::rsa::Rsa;
use pem::Pem;
use rust_util::XResult;
#[cfg(feature = "with-sequoia-openpgp")]
use sequoia_openpgp::crypto::mpi::PublicKey;
use x509_parser::x509::AlgorithmIdentifier;
@@ -42,6 +43,7 @@ pub fn bytes_to_pem<T>(tag: &str, contents: T) -> String where T: Into<Vec<u8>>
pem::encode(&cert_public_key_pem_obj).trim().to_string()
}
#[cfg(feature = "with-sequoia-openpgp")]
pub fn sequoia_openpgp_public_key_pem(public_key: &PublicKey) -> Option<(Vec<u8>, String)> {
match public_key {
PublicKey::RSA { e, n } => {