diff --git a/src/message.js b/src/message.js index 8b3e1ff9..c9627ebe 100644 --- a/src/message.js +++ b/src/message.js @@ -451,7 +451,7 @@ function readArmored(armoredText) { /** * reads an OpenPGP binary string message and returns a message object - * @param {String} binary string message + * @param {Uint8Array} binary message * @return {module:message~Message} new message object * @static */ diff --git a/src/worker/async_proxy.js b/src/worker/async_proxy.js index 88a06270..bf7b7103 100644 --- a/src/worker/async_proxy.js +++ b/src/worker/async_proxy.js @@ -225,7 +225,7 @@ AsyncProxy.prototype.decryptMessage = function(privateKey, message, params) { var self = this; return self.execute(function() { - if(!(String.prototype.isPrototypeOf(privateKey) || typeof privateKey === 'string')) { + if(!(String.prototype.isPrototypeOf(privateKey) || typeof privateKey === 'string' || Uint8Array.prototype.isPrototypeOf(privateKey))) { privateKey = privateKey.toPacketlist(); } diff --git a/src/worker/worker.js b/src/worker/worker.js index 08dc4455..525cf43f 100644 --- a/src/worker/worker.js +++ b/src/worker/worker.js @@ -97,7 +97,7 @@ self.onmessage = function (event) { }); break; case 'decrypt-message': - if(!(String.prototype.isPrototypeOf(msg.privateKey) || typeof msg.privateKey === 'string')) { + if(!(String.prototype.isPrototypeOf(msg.privateKey) || typeof msg.privateKey === 'string' || Uint8Array.prototype.isPrototypeOf(msg.privateKey))) { msg.privateKey = packetlistCloneToKey(msg.privateKey); } msg.message = packetlistCloneToMessage(msg.message.packets);