Package org.gnupg

Class GnuPGDummyKeyUtil.Builder

java.lang.Object
org.gnupg.GnuPGDummyKeyUtil.Builder
Enclosing class:
GnuPGDummyKeyUtil

public static final class GnuPGDummyKeyUtil.Builder extends Object
  • Method Details

    • removePrivateKeys

      public org.bouncycastle.openpgp.PGPSecretKeyRing removePrivateKeys(@Nonnull GnuPGDummyKeyUtil.KeyFilter filter)
      Remove all private keys that match the given GnuPGDummyKeyUtil.KeyFilter from the key ring and replace them with GNU_DUMMY keys with S2K protection mode GnuPGDummyExtension.NO_PRIVATE_KEY.
      Parameters:
      filter - filter to select keys for removal
      Returns:
      modified key ring
    • divertPrivateKeysToCard

      public org.bouncycastle.openpgp.PGPSecretKeyRing divertPrivateKeysToCard(@Nonnull GnuPGDummyKeyUtil.KeyFilter filter)
      Remove all private keys that match the given GnuPGDummyKeyUtil.KeyFilter from the key ring and replace them with GNU_DUMMY keys with S2K protection mode GnuPGDummyExtension.DIVERT_TO_CARD. This method will set the serial number of the card to 0x00000000000000000000000000000000. NOTE: This method does not actually move any keys to a card.
      Parameters:
      filter - filter to select keys for removal
      Returns:
      modified key ring
    • divertPrivateKeysToCard

      public org.bouncycastle.openpgp.PGPSecretKeyRing divertPrivateKeysToCard(@Nonnull GnuPGDummyKeyUtil.KeyFilter filter, @Nullable byte[] cardSerialNumber)
      Remove all private keys that match the given GnuPGDummyKeyUtil.KeyFilter from the key ring and replace them with GNU_DUMMY keys with S2K protection mode GnuPGDummyExtension.DIVERT_TO_CARD. This method will include the card serial number into the encoded dummy key. NOTE: This method does not actually move any keys to a card.
      Parameters:
      filter - filter to select keys for removal
      cardSerialNumber - serial number of the card (at most 16 bytes long)
      Returns:
      modified key ring