File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1029,9 +1029,23 @@ impl ObjectHandle {
10291029 ObjectHandle { handle }
10301030 }
10311031
1032+ /// Create a new object handle from a raw handle.
1033+ /// # Safety
1034+ /// Considered unsafe due to ability for client to arbitrarily create object handles.
1035+ pub unsafe fn new_from_raw ( handle : CK_OBJECT_HANDLE ) -> Self {
1036+ ObjectHandle { handle }
1037+ }
1038+
10321039 pub ( crate ) fn handle ( & self ) -> CK_OBJECT_HANDLE {
10331040 self . handle
10341041 }
1042+
1043+ /// Get the raw handle of the object.
1044+ /// # Safety
1045+ /// Considered unsafe because of pub access to the underlying handle type.
1046+ pub unsafe fn raw_handle ( & self ) -> CK_OBJECT_HANDLE {
1047+ self . handle
1048+ }
10351049}
10361050
10371051impl std:: fmt:: Display for ObjectHandle {
Original file line number Diff line number Diff line change @@ -80,6 +80,13 @@ impl Session {
8080 self . handle
8181 }
8282
83+ /// Get the raw handle of the session.
84+ /// # Safety
85+ /// Considered unsafe because of pub access to the underlying handle type.
86+ pub unsafe fn raw_handle ( & self ) -> CK_SESSION_HANDLE {
87+ self . handle
88+ }
89+
8390 pub ( crate ) fn client ( & self ) -> & Pkcs11 {
8491 & self . client
8592 }
You can’t perform that action at this time.
0 commit comments