Crypto Lib
    Preparing search index...

    Function unlockPrivateKey

    • Parse and decrypt an armored private key.

      Each call produces a fresh OpenPGP key object. A previous iteration cached unlocked keys for throughput, but openpgp.revokeKey and openpgp.reformatKey mutate (or otherwise co-own) the key material, so a single cached instance is not reusable across call sites that perform structural operations. Fresh unlock preserves correctness at the cost of an extra CPU-bound decryptKey per call; callers that need pooling can memoize at their own layer.

      Parameters

      • armoredKey: string
      • passphrase: string

      Returns Promise<PrivateKey>