aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Key.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lang/js/src/Key.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/lang/js/src/Key.js b/lang/js/src/Key.js
index 1e0d3195..6d3cf17d 100644
--- a/lang/js/src/Key.js
+++ b/lang/js/src/Key.js
@@ -61,6 +61,9 @@ export class GPGME_Key {
}
get connection(){
+ if (!this._fingerprint){
+ return gpgme_error('KEY_INVALID');
+ }
if (!this._connection instanceof Connection){
return gpgme_error('CONN_NO_CONNECT');
} else {
@@ -75,6 +78,9 @@ export class GPGME_Key {
}
get fingerprint(){
+ if (!this._fingerprint){
+ return gpgme_error('KEY_INVALID');
+ }
return this._fingerprint;
}
@@ -125,7 +131,7 @@ export class GPGME_Key {
let msg = createMessage ('export_key');
msg.setParameter('armor', true);
if (msg instanceof Error){
- return gpgme_error('INVALID_KEY');
+ return gpgme_error('KEY_INVALID');
}
this.connection.post(msg).then(function(result){
return result.data;
@@ -203,6 +209,9 @@ export class GPGME_Key {
* TODO: check if Promise.then(return)
*/
checkKey(property){
+ if (!this._fingerprint){
+ return gpgme_error('KEY_INVALID');
+ }
return gpgme_error('NOT_YET_IMPLEMENTED');
// TODO: async is not what is to be ecpected from Key information :(
if (!property || typeof(property) !== 'string' ||