generateRequest static method Null safety

Uint8List generateRequest(
  1. HashAlgorithm digestAlgorithm,
  2. Uint8List digest
)

Generate a TS request message

Implementation

static Uint8List generateRequest(
  HashAlgorithm digestAlgorithm,
  Uint8List digest,
) {
  final ts = ASN1Sequence(elements: [
    ASN1Integer.fromtInt(1),
    ASN1Sequence(elements: [
      ASN1Sequence(elements: [
        ASN1ObjectIdentifier(Pkcs.hashAlgorithmIdentifiers[digestAlgorithm]),
        ASN1Null(),
      ]),
      ASN1OctetString(octets: digest),
    ]),
    ASN1Boolean(true),
  ]);

  return ts.encode();
}