I have a CAdES PKCS7 signed file and I need to extract its content.
The below command works very well on my sistem (Windows 10 with OpenSSL 3.3.2 3 Sep 2024 (Library: OpenSSL 3.3.2 3 Sep 2024)).
openssl smime -verify -noverify -in file_name.pdf.signed -inform DER -out file_name.pdf
How can I convert this command to Rust code?
I'm trying with:
pub fn extract_signed(input: &str) -> Result<String> {
let pkcs7 = Pkcs7::from_der(input.as_bytes())?;
let mut out = Vec::new();
let store = X509StoreBuilder::new()?.build();
pkcs7.verify(
&store.all_certificates(),
&store,
None,
Some(&mut out),
openssl::pkcs7::Pkcs7Flags::NOVERIFY,
)?;
let res = String::from_utf8(out)?;
Ok(res)
}
Dear people,
I have a CAdES PKCS7 signed file and I need to extract its content.
The below command works very well on my sistem (Windows 10 with OpenSSL 3.3.2 3 Sep 2024 (Library: OpenSSL 3.3.2 3 Sep 2024)).
How can I convert this command to Rust code?
I'm trying with:
but I'm getting this error:
Why?