From a02a962f7d724e60eea07d80715a8523aa58718a Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 30 Jun 2019 23:35:50 +0800 Subject: [PATCH] Expose pem serialize function for DSA private key Expose private_key_to_pem() & private_key_to_pem_passphrase() for DsaRef --- openssl/src/dsa.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/openssl/src/dsa.rs b/openssl/src/dsa.rs index 1b55d12e..6c71ed3a 100644 --- a/openssl/src/dsa.rs +++ b/openssl/src/dsa.rs @@ -80,6 +80,26 @@ impl DsaRef where T: HasPublic, { + private_key_to_pem! { + /// Serializes the private key to a PEM-encoded DSAPrivateKey structure. + /// + /// The output will have a header of `-----BEGIN DSA PRIVATE KEY-----`. + /// + /// This corresponds to [`PEM_write_bio_DSAPrivateKey`]. + /// + /// [`PEM_write_bio_DSAPrivateKey`]: https://www.openssl.org/docs/man1.1.0/crypto/PEM_write_bio_DSAPrivateKey.html + private_key_to_pem, + /// Serializes the private key to a PEM-encoded encrypted DSAPrivateKey structure. + /// + /// The output will have a header of `-----BEGIN DSA PRIVATE KEY-----`. + /// + /// This corresponds to [`PEM_write_bio_DSAPrivateKey`]. + /// + /// [`PEM_write_bio_DSAPrivateKey`]: https://www.openssl.org/docs/man1.1.0/crypto/PEM_write_bio_DSAPrivateKey.html + private_key_to_pem_passphrase, + ffi::PEM_write_bio_DSAPrivateKey + } + to_pem! { /// Serialies the public key into a PEM-encoded SubjectPublicKeyInfo structure. ///