Skip to main content

Pkcs11Server

Struct Pkcs11Server 

Source
pub struct Pkcs11Server { /* private fields */ }
Expand description

The PKCS#11 dispatch service.

Implementations§

Source§

impl Pkcs11Server

Source

pub fn new(dispatcher: Box<dyn QuorumDispatcher>) -> Self

Construct a new server backed by dispatcher.

Source

pub fn register_quorum( &mut self, slot: SlotId, slot_info: SlotInfo, token_info: TokenInfo, )

Register a slot for a Confium quorum.

Source

pub fn c_sign(&self, slot: SlotId, data: &[u8]) -> Result<Vec<u8>, Pkcs11Error>

C_Sign — sign data via threshold protocol.

Source

pub fn c_decrypt( &self, slot: SlotId, ciphertext: &[u8], ) -> Result<Vec<u8>, Pkcs11Error>

C_Decrypt — decrypt via threshold protocol.

Source

pub fn c_generate_keypair(&self, slot: SlotId) -> Result<Vec<u8>, Pkcs11Error>

C_GenerateKeyPair — trigger DKG.

Source

pub fn slot_info(&self, slot: &SlotId) -> Option<&SlotInfo>

Get slot info.

Source

pub fn token_info(&self, slot: &SlotId) -> Option<&TokenInfo>

Get token info.

Source

pub fn slot_count(&self) -> usize

Number of registered slots.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.