pub struct LocalSoftwareProvider<'a> { /* private fields */ }Expand description
Basil’s local-software PQC provider: ML-DSA signing/verification and ML-KEM encapsulation/decapsulation/envelope over software-custodied keys.
Private keys are custodied as encrypted [SoftwareCustodyKeyRecord]s in the
backend KV store. For each private-key operation the provider reads the
record, validates its non-secret metadata, AEAD-decrypts the seed into a
Zeroizing buffer, runs the PQC math, and drops the seed: it never holds
standing private material. ML-DSA math lives in ml_dsa_sign; ML-KEM math
and the envelope sealing live in ml_kem_envelope.
Provisioning (Self::generate_key for ML-DSA, Self::generate_sealing_key
for ML-KEM) generates a fresh seed, seals it under the catalog storage_key
AEAD key with the custody-binding AAD, and writes the record; the seed never
leaves a Zeroizing buffer and only the public half is returned. BYOK
Self::import_key remains unsupported (custody records are broker-sealed).
Implementations§
Source§impl<'a> LocalSoftwareProvider<'a>
impl<'a> LocalSoftwareProvider<'a>
Sourcepub const PROVIDER_VERSION: &'static str = "1"
pub const PROVIDER_VERSION: &'static str = "1"
Stable provider-implementation version token. It is recorded in the
crypto_provider_version catalog label and bound into the custody-record
AAD, so a record provisioned for a different version fails closed.
Trait Implementations§
Source§impl CryptoProvider for LocalSoftwareProvider<'_>
impl CryptoProvider for LocalSoftwareProvider<'_>
Source§fn provider_id(&self) -> CryptoProviderId
fn provider_id(&self) -> CryptoProviderId
Source§fn generate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn generate_sealing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateSealingKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_sealing_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: GenerateSealingKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn import_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ImportKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn import_key<'life0, 'life1, 'async_trait>(
&'life0 self,
request: ImportKey<'life1>,
) -> Pin<Box<dyn Future<Output = Result<NewKey, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
request: SignRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
request: SignRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
request: VerifyRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn verify<'life0, 'life1, 'async_trait>(
&'life0 self,
request: VerifyRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn encapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EncapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Encapsulation, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EncapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Encapsulation, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn decapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DecapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Zeroizing<Vec<u8>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn decapsulate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: DecapsulateRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Zeroizing<Vec<u8>>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn wrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Envelope, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: WrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Envelope, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn unwrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: UnwrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unwrap_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
request: UnwrapEnvelopeRequest<'life1>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LocalSoftwareProvider<'a>
impl<'a> !UnwindSafe for LocalSoftwareProvider<'a>
impl<'a> Freeze for LocalSoftwareProvider<'a>
impl<'a> Send for LocalSoftwareProvider<'a>
impl<'a> Sync for LocalSoftwareProvider<'a>
impl<'a> Unpin for LocalSoftwareProvider<'a>
impl<'a> UnsafeUnpin for LocalSoftwareProvider<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request