Merge pull request #1290 from Leo1003/fix-dsa-private-pem
Fix private key serializtion in HasPublic impl for DsaRef
This commit is contained in:
commit
f658458c2f
|
|
@ -80,26 +80,6 @@ impl<T> DsaRef<T>
|
||||||
where
|
where
|
||||||
T: HasPublic,
|
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! {
|
to_pem! {
|
||||||
/// Serialies the public key into a PEM-encoded SubjectPublicKeyInfo structure.
|
/// Serialies the public key into a PEM-encoded SubjectPublicKeyInfo structure.
|
||||||
///
|
///
|
||||||
|
|
@ -136,6 +116,26 @@ impl<T> DsaRef<T>
|
||||||
where
|
where
|
||||||
T: HasPrivate,
|
T: HasPrivate,
|
||||||
{
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns a reference to the private key component of `self`.
|
/// Returns a reference to the private key component of `self`.
|
||||||
pub fn priv_key(&self) -> &BigNumRef {
|
pub fn priv_key(&self) -> &BigNumRef {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue