toDer

fun toDer(algorithm: SignatureAlgorithm, signature: ByteArray): ByteArray(source)

The DER encoding of the raw signature signature, r || s with each half as long as a coordinate of the curve of algorithm.

Throws

when algorithm is not ECDSA, signature has the wrong length for it, or r or s is zero, which no ECDSA signature has.