Skip to content

createPkcs12MacData ​

createPkcs12MacData ​

Computes a PKCS#12 MAC over the AuthenticatedSafe and returns the DER-encoded MacData block alongside its parsed representation.

ts
function createPkcs12MacData(
	authenticatedSafe: Uint8Array,
	options: Pkcs12MacOptions,
): Promise<{
  readonly der: Uint8Array;
  readonly parsed: ParsedPkcs12MacData
}>

Parameters

Throws

  • ResultError — with code invalid_iterations when iterations is out of range, password_not_bmp_string when a 'pkcs12-kdf' password contains a UTF-16 surrogate, U+FFFE or U+FFFF, and password_not_utf8 when a 'pbmac1' password contains an unpaired UTF-16 surrogate.

Released under the MIT License.