diff options
Diffstat (limited to 'openssl/src/pkcs7.rs')
-rw-r--r-- | openssl/src/pkcs7.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openssl/src/pkcs7.rs b/openssl/src/pkcs7.rs index a4d93cf9..7820739c 100644 --- a/openssl/src/pkcs7.rs +++ b/openssl/src/pkcs7.rs @@ -61,6 +61,17 @@ impl Pkcs7 { ffi::PEM_read_bio_PKCS7 } + from_der! { + /// Deserializes a DER-encoded PKCS#7 signature + /// + /// This corresponds to [`d2i_PKCS7`]. + /// + /// [`d2i_PKCS7`]: https://www.openssl.org/docs/man1.1.0/man3/d2i_PKCS7.html + from_der, + Pkcs7, + ffi::d2i_PKCS7 + } + /// Parses a message in S/MIME format. /// /// Returns the loaded signature, along with the cleartext message (if @@ -181,6 +192,16 @@ impl Pkcs7Ref { ffi::PEM_write_bio_PKCS7 } + to_der! { + /// Serializes the data into a DER-encoded PKCS#7 structure. + /// + /// This corresponds to [`i2d_PKCS7`]. + /// + /// [`i2d_PKCS7`]: https://www.openssl.org/docs/man1.1.0/man3/i2d_PKCS7.html + to_der, + ffi::i2d_PKCS7 + } + /// Decrypts data using the provided private key. /// /// `pkey` is the recipient's private key, and `cert` is the recipient's |