toDerEncoded

open override fun toDerEncoded(): ByteArray

Encodes the signature for use in ASN.1 DER structures such as X.509 certificates and CRLs.

For ECDSA signatures, this produces an ASN.1 DER SEQUENCE of r and s integers. For EdDSA signatures, this produces r || s. For RSA signatures, this produces the raw RSA signature bytes.