sign
open suspend override fun sign(alias: String, dataToSign: ByteArray, unlockReason: Reason): EcSignature
Signs data with a key.
If the key needs unlocking before use (for example user authentication in any shape or form) and keyUnlockData isn't set or doesn't contain what's needed, KeyLockedException is thrown. Signature algorithm must be specified at key creation time using CreateKeySettings.algorithm.
Return
the signature.
Parameters
alias
The alias of the EC key to sign with.
dataToSign
the data to sign.
unlockReason
the reason for unlocking.
Throws
if the signature algorithm isn’t compatible with the key.
if the key needs unlocking.
if the key is no longer usable.