Skip to main content

ClientCertSigner

Trait ClientCertSigner 

Source
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§

Source

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.

Source

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

Source§

const TYPE_ID_META: MetadataBuffer

Source§

type FfiType = Handle

Source§

fn lower( obj: Arc<dyn ClientCertSigner>, ) -> <dyn ClientCertSigner as FfiConverterArc<T>>::FfiType

Source§

fn try_lift( handle: <dyn ClientCertSigner as FfiConverterArc<T>>::FfiType, ) -> Result<Arc<dyn ClientCertSigner>, Error>

Source§

fn write(obj: Arc<dyn ClientCertSigner>, buf: &mut Vec<u8>)

Source§

fn try_read(buf: &mut &[u8]) -> Result<Arc<dyn ClientCertSigner>, Error>

Source§

impl<T> LiftRef<T> for dyn ClientCertSigner

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§