### File

`src/app/_services/keystore.service.ts`

### Index

###### Properties
Private Static mutableKeyStore
###### Methods
Static Async getKeystore

### Constructor

`constructor()`
Defined in src/app/_services/keystore.service.ts:8

### Methods

Static Async getKeystore
`getKeystore()`
Defined in src/app/_services/keystore.service.ts:12
Returns : `Promise<MutableKeyStore>`

### Properties

Private Static mutableKeyStore
Type : `MutableKeyStore`
Defined in src/app/_services/keystore.service.ts:8

    import { Injectable } from '@angular/core';
    import { MutableKeyStore, MutablePgpKeyStore } from '@app/_pgp';

    @Injectable({
      providedIn: 'root',
    })
    export class KeystoreService {
      private static mutableKeyStore: MutableKeyStore;

      constructor() {}

      public static async getKeystore(): Promise<MutableKeyStore> {
        return new Promise(async (resolve, reject) => {
          if (!KeystoreService.mutableKeyStore) {
            this.mutableKeyStore = new MutablePgpKeyStore();
            await this.mutableKeyStore.loadKeyring();
            return resolve(KeystoreService.mutableKeyStore);
          }
          return resolve(KeystoreService.mutableKeyStore);
        });
      }
    }

# result-matching ""

# No results matching ""