pub trait ClientCertSigner: Send + Sync {
// Required methods
fn sign(
&self,
scheme: TlsSigScheme,
message: Vec<u8>,
) -> Result<Vec<u8>, ClientCertSignerError>;
fn schemes(&self) -> Vec<TlsSigScheme>;
}Expand description
Signs TLS handshakes with the private key of a client certificate, which never leaves the host application.
Both methods are called synchronously on the caller’s thread: schemes inside
ClientCertificate::new, and sign inside ClientCertificate::validate and during the TLS
handshake, on the thread that awaits the networked SDK call. Apps must not await networked SDK
calls on the main thread, and implementations must be thread-safe and must not block on user
interaction.
Required Methods§
Sourcefn sign(
&self,
scheme: TlsSigScheme,
message: Vec<u8>,
) -> Result<Vec<u8>, ClientCertSignerError>
fn sign( &self, scheme: TlsSigScheme, message: Vec<u8>, ) -> Result<Vec<u8>, ClientCertSignerError>
Signs message with scheme, which is always one of the schemes returned by
schemes.
message is the raw data to sign, not a digest: hash it with the scheme’s hash as part of
signing. The result must be an ASN.1 DER ECDSA-Sig-Value for ECDSA, an RSASSA-PKCS1-v1_5
signature for the PKCS#1 schemes, and an RSASSA-PSS signature with MGF1 over the same hash
and a salt as long as the digest for the PSS schemes.
Sourcefn schemes(&self) -> Vec<TlsSigScheme>
fn schemes(&self) -> Vec<TlsSigScheme>
Every scheme the key can sign with. The SDK calls this once, keeps those that fit the leaf’s key, and picks its preferred one among those the server accepts.
Trait Implementations§
Source§impl<T> FfiConverterArc<T> for dyn ClientCertSigner
impl<T> FfiConverterArc<T> for dyn ClientCertSigner
const TYPE_ID_META: MetadataBuffer
type FfiType = Handle
fn lower( obj: Arc<dyn ClientCertSigner>, ) -> <dyn ClientCertSigner as FfiConverterArc<T>>::FfiType
fn try_lift( handle: <dyn ClientCertSigner as FfiConverterArc<T>>::FfiType, ) -> Result<Arc<dyn ClientCertSigner>, Error>
fn write(obj: Arc<dyn ClientCertSigner>, buf: &mut Vec<u8>)
fn try_read(buf: &mut &[u8]) -> Result<Arc<dyn ClientCertSigner>, Error>
Source§impl<T> LiftRef<T> for dyn ClientCertSigner
impl<T> LiftRef<T> for dyn ClientCertSigner
type LiftType = Arc<dyn ClientCertSigner>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".