embedSignature static method

Uint8List embedSignature({
  1. required Uint8List preparedPdfBytes,
  2. required Uint8List pkcs7Bytes,
})

Embeds PKCS#7 into the /Contents placeholder.

Implementation

static Uint8List embedSignature({
  required Uint8List preparedPdfBytes,
  required Uint8List pkcs7Bytes,
}) {
  final contentsRange = findContentsRange(preparedPdfBytes, strict: false);
  final bytes = Uint8List.fromList(preparedPdfBytes);
  _embedSignature(bytes, contentsRange.start, contentsRange.end, pkcs7Bytes);
  return bytes;
}