Module: crypto/pkcs1

Provides EME-PKCS1-v1_5 encoding and decoding and EMSA-PKCS1-v1_5 encoding function

Source:
See:

Members

(inner, constant) hash_headers

ASN1 object identifiers for hashes

Source:
See:

Methods

(static) emeDecode(encoded, randomPayload) → {Uint8Array}

Decode a EME-PKCS1-v1_5 padded message

Parameters:
Name Type Description
encoded Uint8Array

Encoded message bytes

randomPayload Uint8Array

Data to return in case of decoding error (needed for constant-time processing)

Source:
See:
Throws:

on decoding failure, unless randomPayload is provided

Type
Error
Returns:

decoded data or randomPayload (on error, if given)

Type
Uint8Array

(static) emeEncode(message, keyLength) → {Uint8Array}

Create a EME-PKCS1-v1_5 padded message

Parameters:
Name Type Description
message Uint8Array

Message to be encoded

keyLength Integer

The length in octets of the key modulus

Source:
See:
Returns:

EME-PKCS1 padded message.

Type
Uint8Array

(static) emsaEncode(algo, hashed, emLen) → {Uint8Array}

Create a EMSA-PKCS1-v1_5 padded message

Parameters:
Name Type Description
algo Integer

Hash algorithm type used

hashed Uint8Array

Message to be encoded

emLen Integer

Intended length in octets of the encoded message

Source:
See:
Returns:

Encoded message.

Type
Uint8Array