aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Keyring.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-05-28 14:52:50 +0000
committerMaximilian Krambach <[email protected]>2018-05-28 14:52:50 +0000
commitd4adbf453d39659eee378b2be1d7125315d76083 (patch)
treef560b50bacf8b64a019326c2cf4c72b43457adc8 /lang/js/src/Keyring.js
parentjs: implement Key handling (1) (diff)
downloadgpgme-d4adbf453d39659eee378b2be1d7125315d76083.tar.gz
gpgme-d4adbf453d39659eee378b2be1d7125315d76083.zip
js: Treat a connection as a gpgme Context
-- * After an operation a connection should be disconnected again. The "end of operation" is now assumed to be either an error as answer, or a message not including a "more" * GPGME, GPGME_Key, GPGME_Keyring don't require a connection anymore * Message.js: The Message.post() method will open a connection as required
Diffstat (limited to 'lang/js/src/Keyring.js')
-rw-r--r--lang/js/src/Keyring.js20
1 files changed, 3 insertions, 17 deletions
diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js
index 80792f77..9abb9ec3 100644
--- a/lang/js/src/Keyring.js
+++ b/lang/js/src/Keyring.js
@@ -22,23 +22,9 @@ import {createMessage} from './Message'
import {GPGME_Key} from './Key'
import { isFingerprint } from './Helpers';
import { gpgme_error } from './Errors';
-import { Connection } from './Connection';
export class GPGME_Keyring {
- constructor(connection){
- this.connection = connection;
- }
-
- set connection(connection){
- if (!this._connection && connection instanceof Connection){
- this._connection = connection;
- }
- }
- get connection(){
- if (this._connection instanceof Connection){
- return this._connection;
- }
- return gpgme_error('CONN_NO_CONNECT');
+ constructor(){
}
/**
@@ -58,7 +44,7 @@ export class GPGME_Keyring {
if (include_secret){
msg.setParameter('with-secret', true);
}
- me.connection.post(msg).then(function(result){
+ msg.post().then(function(result){
let fpr_list = [];
let resultset = [];
if (!Array.isArray(result.keys)){
@@ -68,7 +54,7 @@ export class GPGME_Keyring {
fpr_list = result.keys;
}
for (let i=0; i < fpr_list.length; i++){
- let newKey = new GPGME_Key(fpr_list[i], me._connection);
+ let newKey = new GPGME_Key(fpr_list[i]);
if (newKey instanceof GPGME_Key){
resultset.push(newKey);
}