Skip to content

parsePkcs12MacDataOrThrow ​

parsePkcs12MacDataOrThrow ​

Throwing core for parsePkcs12MacData. When password is provided, verifies the MAC and reports the outcome in verification, and throws before deriving when the iteration count exceeds options.maxKdfIterations or Number.MAX_SAFE_INTEGER. The default limit is 100_000 for the PKCS#12 KDF and 2_000_000 for the PBKDF2 behind PBMAC1. Without password no key is derived, so options.maxKdfIterations is not applied and verification is 'unchecked'. Throws a ResultError carrying a ParsePkcs12MacDataErrorCode for an unsupported MAC, a PBMAC1 key length below 20 octets, or a password the MAC cannot encode.

ts
function parsePkcs12MacDataOrThrow(
	der: Uint8Array,
	authenticatedSafe: Uint8Array,
	password?: string,
	options?: ParsePkcs12MacDataOptions,
): Promise<ParsedPkcs12MacData>

Parameters

Released under the MIT License.