Use PKeyRef in X509Generator

This commit is contained in:
Steven Fackler 2016-10-29 16:37:26 -07:00
parent c2b38d8bb3
commit c89f2c0be0
1 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ use asn1::Asn1TimeRef;
use bio::{MemBio, MemBioSlice}; use bio::{MemBio, MemBioSlice};
use crypto::CryptoString; use crypto::CryptoString;
use hash::MessageDigest; use hash::MessageDigest;
use pkey::PKey; use pkey::{PKey, PKeyRef};
use rand::rand_bytes; use rand::rand_bytes;
use error::ErrorStack; use error::ErrorStack;
use ffi; use ffi;
@ -278,7 +278,7 @@ impl X509Generator {
} }
/// Sets the certificate public-key, then self-sign and return it /// Sets the certificate public-key, then self-sign and return it
pub fn sign(&self, p_key: &PKey) -> Result<X509, ErrorStack> { pub fn sign(&self, p_key: &PKeyRef) -> Result<X509, ErrorStack> {
ffi::init(); ffi::init();
unsafe { unsafe {
@ -330,7 +330,7 @@ impl X509Generator {
} }
/// Obtain a certificate signing request (CSR) /// Obtain a certificate signing request (CSR)
pub fn request(&self, p_key: &PKey) -> Result<X509Req, ErrorStack> { pub fn request(&self, p_key: &PKeyRef) -> Result<X509Req, ErrorStack> {
let cert = match self.sign(p_key) { let cert = match self.sign(p_key) {
Ok(c) => c, Ok(c) => c,
Err(x) => return Err(x), Err(x) => return Err(x),