feat: init commit

This commit is contained in:
2024-08-14 23:40:41 +08:00
parent e1e72ed097
commit 29a03ee225
11 changed files with 342 additions and 41 deletions

View File

@@ -277,7 +277,7 @@ cryptoki_fn!(
}
);
#[cfg(not(feature = "custom-function-list"))]
// #[cfg(not(feature = "custom-function-list"))]
cryptoki_fn!(
unsafe fn C_GetFunctionList(ppFunctionList: CK_FUNCTION_LIST_PTR_PTR) {
not_null!(ppFunctionList);

View File

@@ -15,22 +15,23 @@
use std::collections::HashMap;
use cached::{Cached, TimedCache};
use tracing::{instrument, warn};
use native_pkcs11_core::{
attribute::{Attribute, AttributeType, Attributes},
attribute::{Attribute, Attributes, AttributeType},
Result,
};
use native_pkcs11_traits::{backend, KeySearchOptions};
use pkcs11_sys::{
CK_OBJECT_HANDLE,
CKO_CERTIFICATE,
CKO_PRIVATE_KEY,
CKO_PUBLIC_KEY,
CKO_SECRET_KEY,
CKP_BASELINE_PROVIDER,
CK_OBJECT_HANDLE,
};
use tracing::{instrument, warn};
use crate::{object::Object, Error};
use crate::{Error, object::Object};
#[derive(Debug)]
pub struct ObjectStore {
@@ -200,13 +201,15 @@ impl Default for ObjectStore {
mod tests {
use std::vec;
use native_pkcs11_traits::{backend, random_label, KeyAlgorithm};
use pkcs11_sys::CKO_PRIVATE_KEY;
use serial_test::serial;
use super::*;
use native_pkcs11_traits::{backend, KeyAlgorithm, random_label};
use pkcs11_sys::CKO_PRIVATE_KEY;
use crate::tests::test_init;
use super::*;
#[test]
#[serial]
fn test_object_store() {