pub struct Pkcs11Server { /* private fields */ }Expand description
The PKCS#11 dispatch service.
Implementations§
Source§impl Pkcs11Server
impl Pkcs11Server
Sourcepub fn new(dispatcher: Box<dyn QuorumDispatcher>) -> Self
pub fn new(dispatcher: Box<dyn QuorumDispatcher>) -> Self
Construct a new server backed by dispatcher.
Sourcepub fn register_quorum(
&mut self,
slot: SlotId,
slot_info: SlotInfo,
token_info: TokenInfo,
)
pub fn register_quorum( &mut self, slot: SlotId, slot_info: SlotInfo, token_info: TokenInfo, )
Register a slot for a Confium quorum.
Sourcepub fn c_sign(&self, slot: SlotId, data: &[u8]) -> Result<Vec<u8>, Pkcs11Error>
pub fn c_sign(&self, slot: SlotId, data: &[u8]) -> Result<Vec<u8>, Pkcs11Error>
C_Sign — sign data via threshold protocol.
Sourcepub fn c_decrypt(
&self,
slot: SlotId,
ciphertext: &[u8],
) -> Result<Vec<u8>, Pkcs11Error>
pub fn c_decrypt( &self, slot: SlotId, ciphertext: &[u8], ) -> Result<Vec<u8>, Pkcs11Error>
C_Decrypt — decrypt via threshold protocol.
Sourcepub fn c_generate_keypair(&self, slot: SlotId) -> Result<Vec<u8>, Pkcs11Error>
pub fn c_generate_keypair(&self, slot: SlotId) -> Result<Vec<u8>, Pkcs11Error>
C_GenerateKeyPair — trigger DKG.
Sourcepub fn token_info(&self, slot: &SlotId) -> Option<&TokenInfo>
pub fn token_info(&self, slot: &SlotId) -> Option<&TokenInfo>
Get token info.
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Number of registered slots.
Auto Trait Implementations§
impl !RefUnwindSafe for Pkcs11Server
impl !UnwindSafe for Pkcs11Server
impl Freeze for Pkcs11Server
impl Send for Pkcs11Server
impl Sync for Pkcs11Server
impl Unpin for Pkcs11Server
impl UnsafeUnpin for Pkcs11Server
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more