fun PrivateKey.sign(bytesToSign: ByteArray): DigitalSignature
Utility to simplify the act of signing a byte array.
fun PrivateKey.sign(bytesToSign: ByteArray, publicKey: PublicKey): WithKey
Utility to simplify the act of signing a byte array and return a DigitalSignature.WithKey object.
Note that there is no check if the public key matches with the signing private key.