Skip to content

Commit 8e1268e

Browse files
Add a string getter for the verification key (#14)
* 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]>
1 parent e34784d commit 8e1268e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

c-wrapper/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2022 Contributors to the Veraison project.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#![allow(clippy::multiple_crate_versions)]
5+
46
use std::ffi::{c_void, CStr, CString};
57

68
use core::slice;

rust-client/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2022 Contributors to the Veraison project.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#![allow(clippy::multiple_crate_versions)]
5+
46
#[derive(thiserror::Error, PartialEq, Eq)]
57
pub enum Error {
68
#[error("configuration error: {0}")]
@@ -345,6 +347,11 @@ impl VerificationApi {
345347
.map_err(|e| Error::DataConversionError(e.to_string()))
346348
}
347349

350+
/// Obtains the EAR verification public key as a JSON string.
351+
pub fn ear_verification_key_as_string(&self) -> String {
352+
self.ear_verification_key.to_string()
353+
}
354+
348355
/// Obtains the signature algorithm scheme used with the EAR.
349356
pub fn ear_verification_algorithm(&self) -> String {
350357
match &self.ear_verification_key.algorithm {

0 commit comments

Comments
 (0)