Skip to content

Commit 9f2fbad

Browse files
committed
kmgmt: Add RSA key to key object
The RSA component will store the modulus and exponent parts of the RSA public key in the Provider key object. Signed-off-by: Gowtham Suresh Kumar <[email protected]>
1 parent 8c61aa7 commit 9f2fbad

File tree

1 file changed

+10
-10
lines changed
  • parsec-openssl-provider/src/keymgmt

1 file changed

+10
-10
lines changed

parsec-openssl-provider/src/keymgmt/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
// Copyright 2024 Contributors to the Parsec project.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use crate::openssl_bindings::{
5-
OSSL_ALGORITHM, OSSL_DISPATCH, OSSL_FUNC_KEYMGMT_DUP, OSSL_FUNC_KEYMGMT_FREE,
6-
OSSL_FUNC_KEYMGMT_HAS, OSSL_FUNC_KEYMGMT_IMPORT, OSSL_FUNC_KEYMGMT_IMPORT_TYPES,
7-
OSSL_FUNC_KEYMGMT_MATCH, OSSL_FUNC_KEYMGMT_NEW, OSSL_FUNC_KEYMGMT_SETTABLE_PARAMS,
8-
OSSL_FUNC_KEYMGMT_SET_PARAMS, OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS, OSSL_PARAM,
9-
OSSL_PARAM_UTF8_PTR,
10-
};
4+
use crate::openssl_bindings::*;
115
use crate::{
12-
ParsecProviderContext, PARSEC_PROVIDER_DESCRIPTION_ECDSA, PARSEC_PROVIDER_DESCRIPTION_RSA,
13-
PARSEC_PROVIDER_DFLT_PROPERTIES, PARSEC_PROVIDER_ECDSA_NAME, PARSEC_PROVIDER_KEY_NAME,
14-
PARSEC_PROVIDER_RSA_NAME,
6+
ParsecProviderContext, PARSEC_PROVIDER_DESCRIPTION_RSA, PARSEC_PROVIDER_DFLT_PROPERTIES,
7+
PARSEC_PROVIDER_KEY_NAME, PARSEC_PROVIDER_RSA_NAME,
158
};
169
use parsec_openssl2::types::VOID_PTR;
1710
use parsec_openssl2::*;
@@ -20,13 +13,15 @@ use std::sync::{Arc, RwLock};
2013
pub struct ParsecProviderKeyObject {
2114
provctx: Arc<ParsecProviderContext>,
2215
key_name: Option<String>,
16+
rsa_key: Option<RsaPublicKey>,
2317
}
2418

2519
impl Clone for ParsecProviderKeyObject {
2620
fn clone(&self) -> Self {
2721
ParsecProviderKeyObject {
2822
provctx: self.provctx.clone(),
2923
key_name: self.key_name.clone(),
24+
rsa_key: self.rsa_key.clone(),
3025
}
3126
}
3227
}
@@ -36,6 +31,7 @@ impl ParsecProviderKeyObject {
3631
ParsecProviderKeyObject {
3732
provctx: provctx.clone(),
3833
key_name: None,
34+
rsa_key: None,
3935
}
4036
}
4137

@@ -46,6 +42,10 @@ impl ParsecProviderKeyObject {
4642
pub fn get_key_name(&self) -> &Option<String> {
4743
&self.key_name
4844
}
45+
46+
pub fn get_rsa_key(&self) -> &Option<RsaPublicKey> {
47+
&self.rsa_key
48+
}
4949
}
5050

5151
/*

0 commit comments

Comments
 (0)