Skip to content

Commit

Permalink
Add a string getter for the verification key (#14)
Browse files Browse the repository at this point in the history
* Add a string getter for the verification key, helping this library to dovetail with the rust-ear library.
* Allow clippy multiple_crate_versions checks, because they are triggered through the dependency graph in a way that we can't control.

Signed-off-by: Paul Howard <[email protected]>
  • Loading branch information
paulhowardarm authored Apr 29, 2024
1 parent e34784d commit 8e1268e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions c-wrapper/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0

#![allow(clippy::multiple_crate_versions)]

use std::ffi::{c_void, CStr, CString};

use core::slice;
Expand Down
7 changes: 7 additions & 0 deletions rust-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2022 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0

#![allow(clippy::multiple_crate_versions)]

#[derive(thiserror::Error, PartialEq, Eq)]
pub enum Error {
#[error("configuration error: {0}")]
Expand Down Expand Up @@ -345,6 +347,11 @@ impl VerificationApi {
.map_err(|e| Error::DataConversionError(e.to_string()))
}

/// Obtains the EAR verification public key as a JSON string.
pub fn ear_verification_key_as_string(&self) -> String {
self.ear_verification_key.to_string()
}

/// Obtains the signature algorithm scheme used with the EAR.
pub fn ear_verification_algorithm(&self) -> String {
match &self.ear_verification_key.algorithm {
Expand Down

0 comments on commit 8e1268e

Please sign in to comment.