sign

abstract fun sign(alias: String, data: ByteArray): ByteArray?(source)

Signs data with the private key under alias using ECDSA with SHA-256.

Return

the DER-encoded signature, or null if no key exists for alias.

Throws

if the backend is unavailable or signing fails, for example with reason Locked while the device is locked.

if alias is blank or contains NUL, CR, or LF.