diff --git a/src/app/_helpers/pgp-key-store.ts b/src/app/_helpers/pgp-key-store.ts index 14d2534..d69d9b7 100644 --- a/src/app/_helpers/pgp-key-store.ts +++ b/src/app/_helpers/pgp-key-store.ts @@ -19,7 +19,8 @@ interface MutableKeyStore{ getPublicKeyForSubkeyId: (subkeyId: string) => any; getPublicKeysForAddress: (address: string) => Array; removeKeysForId: (keyId: string) => Array; - removePublicKeysForId: (keyId: string) => any; + removePublicKeyForId: (keyId: string) => any; + removePublicKey: (publicKey: any) => any; clearKeysInKeyring: () => void; // revokeKey: (publicKey) => void; } @@ -105,7 +106,12 @@ class MutablePgpKeyStore implements MutableKeyStore{ return keyring.removeKeysForId(keyId); } - removePublicKeysForId(keyId): any { + removePublicKeyForId(keyId): any { + return keyring.publicKeys.removeForId(keyId); + } + + removePublicKey(publicKey: any): any { + const keyId = publicKey.getKeyId().toHex(); return keyring.publicKeys.removeForId(keyId); } diff --git a/src/app/_services/auth.service.ts b/src/app/_services/auth.service.ts index 8373611..bbcf42f 100644 --- a/src/app/_services/auth.service.ts +++ b/src/app/_services/auth.service.ts @@ -4,7 +4,6 @@ import { hobaParseChallengeHeader } from '@src/assets/js/hoba.js'; import { signChallenge } from '@src/assets/js/hoba-pgp.js'; import {environment} from '@src/environments/environment'; import {HttpClient} from '@angular/common/http'; -const openpgp = require('openpgp'); const origin = 'http://localhost:4444'; const pgpKeyStore = new UnsafeKeyStore();