From e73607e662820339d3ae74eefdfb5099f516df29 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sun, 8 Dec 2019 17:12:19 +0000 Subject: [PATCH] Rename Certificate::new to Certificate::from_bytes --- src/certificate.rs | 4 ++-- src/key.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/certificate.rs b/src/certificate.rs index 3f70452..133b5b5 100644 --- a/src/certificate.rs +++ b/src/certificate.rs @@ -152,7 +152,7 @@ impl Certificate { return Err(Error::InvalidObject); } - Certificate::new(buf) + Certificate::from_bytes(buf) } /// Write this certificate into the YubiKey in the given slot @@ -170,7 +170,7 @@ impl Certificate { } /// Initialize a local certificate struct from the given bytebuffer - pub fn new(cert: impl Into) -> Result { + pub fn from_bytes(cert: impl Into) -> Result { let cert = cert.into(); if cert.is_empty() { diff --git a/src/key.rs b/src/key.rs index 84826d2..4aadbcf 100644 --- a/src/key.rs +++ b/src/key.rs @@ -410,7 +410,7 @@ impl Key { }; if !buf.is_empty() { - let cert = Certificate::new(buf)?; + let cert = Certificate::from_bytes(buf)?; keys.push(Key { slot, cert }); } }