code: function assertEncryptDecrypt(data, jwkey, hash, label, mode){
    if (Object.keys(params.hashes).indexOf(hash) < 0) throw new Error('UnsupportedHash');
    if (!(data instanceof Uint8Array)) throw new Error('InvalidMessageFormat');
    if (!(label instanceof Uint8Array)) throw new Error('InvalidLabelFormat');
    if (jwkey.kty !== 'RSA') throw new Error('InvalidJwkRsaKey');
    checkOaepLength(mode,
      Object.assign({ k: jseu.encoder.decodeBase64Url(jwkey.n).length, label, hash},
        (mode === 'encrypt') ? {mLen: data.length, cLen: 0} : {mLen: 0, cLen: data.length} )
    );
  
    return true;
  }
docs: RSA Encryption/Decryption Parameter Check.
  @param {Uint8Array} data - message or encrypted message byte array.
  @param {JsonWebKey} jwkey - Public/Private key in JWK format.
  @param {String} hash - Name of hash algorithm like 'SHA-256'
  @param {Uint8Array} label - RSA-OAEP label.
  @param {String} mode - 'encrypt' or 'decrypt'
  @return {boolean} - Always true, otherwise thrown.
  @throws {Error} - Throws if UnsuppotedHash, InvalidMessageFormat, InvalidLabelFormat or InvalidJwkRsaKey.