From ecad77263585cd5954758f797327d98232d880dc Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Tue, 22 May 2018 14:24:16 +0200 Subject: js: transfer encoding changes -- * Uint8Arrays are not supported for now there are unsolved issues in conversion, and they are lower priority * encrypt gains a new option to indicate that input values are base64 encoded * as decrypted values are always base64 encoded, the option base64 will not try to decode the result into utf, but leave it as it is --- lang/js/src/Message.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lang/js/src/Message.js') diff --git a/lang/js/src/Message.js b/lang/js/src/Message.js index 6a59c3e0..932212a6 100644 --- a/lang/js/src/Message.js +++ b/lang/js/src/Message.js @@ -41,6 +41,7 @@ export class GPGME_Message { constructor(operation){ this.operation = operation; + this._expected = 'string'; } set operation (op){ @@ -58,6 +59,19 @@ export class GPGME_Message { return this._msg.op; } + set expected(string){ + if (string === 'base64'){ + this._expected = 'base64'; + } + } + + get expected() { + if (this._expected === "base64"){ + return this._expected; + } + return "string"; + } + /** * Sets a parameter for the message. Note that the operation has to be set * first, to be able to check if the parameter is permittted -- cgit v1.2.3