derEncode method

Uint8List derEncode(
  1. Uint8List hash,
  2. HashAlgorithm digest
)

Encode a hash to a DER message

Implementation

Uint8List derEncode(Uint8List hash, HashAlgorithm digest) {
  return ASN1Sequence(elements: [
    ASN1Sequence(elements: [
      ASN1ObjectIdentifier(Pkcs.hashAlgorithmIdentifiers[digest]),
      ASN1Null(),
    ]),
    ASN1OctetString(octets: hash),
  ]).encode();
}