DelegatingSigningDriver

class DelegatingSigningDriver(publicKeyProvider: suspend () -> CryptoOuterClass.SigningPublicKey, signer: suspend (ByteArray) -> CryptoOuterClass.Signature) : SigningDriver

The custody hook: a SigningDriver whose key operations are delegated to caller-supplied suspend functions. Wrap any external signer — Fireblocks, BitGo, Dfns, an HSM, a remote co-signer — by adapting its SDK calls to the two callbacks; everything above the driver (party onboarding, interactive submission, token-standard writes) works unchanged.

The callbacks own the encodings: publicKeyProvider must return a Ledger-API-compatible key (see CryptoOuterClass.SigningPublicKey) and signer a signature whose format/algorithm match that key. For P-256 custody backends that emit raw r‖s signatures, convert to DER before returning (CryptoOuterClass.SignatureFormat.SIGNATURE_FORMAT_DER).

Constructors

Link copied to clipboard
constructor(publicKeyProvider: suspend () -> CryptoOuterClass.SigningPublicKey, signer: suspend (ByteArray) -> CryptoOuterClass.Signature)

Functions

Link copied to clipboard
open suspend override fun publicKey(): CryptoOuterClass.SigningPublicKey

The public key in a Ledger-API-compatible encoding.

Link copied to clipboard
open suspend override fun sign(bytes: ByteArray): CryptoOuterClass.Signature

Signs bytes (a Canton-provided hash) with the driver's private key.