1
1
// Copyright 2024 Contributors to the Parsec project.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
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:: * ;
11
5
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 ,
15
8
} ;
16
9
use parsec_openssl2:: types:: VOID_PTR ;
17
10
use parsec_openssl2:: * ;
@@ -20,13 +13,15 @@ use std::sync::{Arc, RwLock};
20
13
pub struct ParsecProviderKeyObject {
21
14
provctx : Arc < ParsecProviderContext > ,
22
15
key_name : Option < String > ,
16
+ rsa_key : Option < RsaPublicKey > ,
23
17
}
24
18
25
19
impl Clone for ParsecProviderKeyObject {
26
20
fn clone ( & self ) -> Self {
27
21
ParsecProviderKeyObject {
28
22
provctx : self . provctx . clone ( ) ,
29
23
key_name : self . key_name . clone ( ) ,
24
+ rsa_key : self . rsa_key . clone ( ) ,
30
25
}
31
26
}
32
27
}
@@ -36,6 +31,7 @@ impl ParsecProviderKeyObject {
36
31
ParsecProviderKeyObject {
37
32
provctx : provctx. clone ( ) ,
38
33
key_name : None ,
34
+ rsa_key : None ,
39
35
}
40
36
}
41
37
@@ -46,6 +42,10 @@ impl ParsecProviderKeyObject {
46
42
pub fn get_key_name ( & self ) -> & Option < String > {
47
43
& self . key_name
48
44
}
45
+
46
+ pub fn get_rsa_key ( & self ) -> & Option < RsaPublicKey > {
47
+ & self . rsa_key
48
+ }
49
49
}
50
50
51
51
/*
0 commit comments