diff --git a/.gitignore b/.gitignore index 5f9ff5d6..c03e55e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -.vscode/ \ No newline at end of file +.vscode/ +.zed/ diff --git a/Cargo.lock b/Cargo.lock index ab6cc588..24587e84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1546,7 +1546,7 @@ dependencies = [ [[package]] name = "sev" -version = "7.1.0" +version = "7.1.1" dependencies = [ "base64", "bitfield", diff --git a/Cargo.toml b/Cargo.toml index 0858b3c4..53a1f3c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sev" -version = "7.1.0" +version = "7.1.1" authors = [ "Nathaniel McCallum ", "The VirTEE Project Developers", diff --git a/src/certs/snp/cert_nossl.rs b/src/certs/snp/cert_nossl.rs index 88aeb1a4..8a7cb35c 100644 --- a/src/certs/snp/cert_nossl.rs +++ b/src/certs/snp/cert_nossl.rs @@ -62,6 +62,11 @@ impl Verifiable for (&Certificate, &Certificate) { } impl Certificate { + /// Gets a reference to the X509 certificate inside + pub fn cert(&self) -> &x509_cert::Certificate { + &self.0 + } + /// Create a Certificate from a PEM-encoded X509 structure. pub fn from_pem(pem: &[u8]) -> Result { let cert = x509_cert::Certificate::from_pem(pem) @@ -106,3 +111,15 @@ impl Certificate { fn io_error_other>(error: S) -> io::Error { io::Error::new(ErrorKind::Other, error.into()) } + +impl From for Certificate { + fn from(value: x509_cert::Certificate) -> Self { + Self(value) + } +} + +impl From for x509_cert::Certificate { + fn from(Certificate(cert): Certificate) -> Self { + cert + } +}