Rename keys to publicKeys in message.encrypt()
This commit is contained in:
parent
31df9c07da
commit
0f8bfe2dca
|
@ -240,19 +240,19 @@ Message.prototype.encrypt = function(keys, passwords) {
|
||||||
* @param {(Array<String>|String)} password(s) for message encryption
|
* @param {(Array<String>|String)} password(s) for message encryption
|
||||||
* @return {Array<module:message~Message>} new message with encrypted content
|
* @return {Array<module:message~Message>} new message with encrypted content
|
||||||
*/
|
*/
|
||||||
export function encryptSessionKey(sessionKey, symAlgo, keys, passwords) {
|
export function encryptSessionKey(sessionKey, symAlgo, publicKeys, passwords) {
|
||||||
|
|
||||||
/** Convert to arrays if necessary */
|
/** Convert to arrays if necessary */
|
||||||
if (keys && !Array.prototype.isPrototypeOf(keys)) {
|
if (publicKeys && !Array.prototype.isPrototypeOf(publicKeys)) {
|
||||||
keys = [keys];
|
publicKeys = [publicKeys];
|
||||||
}
|
}
|
||||||
if (passwords && !Array.prototype.isPrototypeOf(passwords)) {
|
if (passwords && !Array.prototype.isPrototypeOf(passwords)) {
|
||||||
passwords = [passwords];
|
passwords = [passwords];
|
||||||
}
|
}
|
||||||
|
|
||||||
var packetlist = new packet.List();
|
var packetlist = new packet.List();
|
||||||
if (keys) {
|
if (publicKeys) {
|
||||||
keys.forEach(function(key) {
|
publicKeys.forEach(function(key) {
|
||||||
var encryptionKeyPacket = key.getEncryptionKeyPacket();
|
var encryptionKeyPacket = key.getEncryptionKeyPacket();
|
||||||
if (encryptionKeyPacket) {
|
if (encryptionKeyPacket) {
|
||||||
var pkESKeyPacket = new packet.PublicKeyEncryptedSessionKey();
|
var pkESKeyPacket = new packet.PublicKeyEncryptedSessionKey();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user