Return a Stack in Pkcs12

This commit is contained in:
Steven Fackler 2016-11-05 13:57:05 -07:00
parent ed69d6b037
commit 8037258913
2 changed files with 8 additions and 2 deletions

View File

@ -49,7 +49,7 @@ impl Pkcs12 {
let pkey = PKey::from_ptr(pkey); let pkey = PKey::from_ptr(pkey);
let cert = X509::from_ptr(cert); let cert = X509::from_ptr(cert);
let chain = Stack::from_ptr(chain).into_iter().collect(); let chain = Stack::from_ptr(chain);
Ok(ParsedPkcs12 { Ok(ParsedPkcs12 {
pkey: pkey, pkey: pkey,
@ -63,7 +63,7 @@ impl Pkcs12 {
pub struct ParsedPkcs12 { pub struct ParsedPkcs12 {
pub pkey: PKey, pub pkey: PKey,
pub cert: X509, pub cert: X509,
pub chain: Vec<X509>, pub chain: Stack<X509>,
} }
#[cfg(test)] #[cfg(test)]

View File

@ -480,6 +480,12 @@ impl AsRef<X509Ref> for X509 {
} }
} }
impl AsRef<X509Ref> for X509Ref {
fn as_ref(&self) -> &X509Ref {
self
}
}
impl Borrow<X509Ref> for X509 { impl Borrow<X509Ref> for X509 {
fn borrow(&self) -> &X509Ref { fn borrow(&self) -> &X509Ref {
&*self &*self