Package org.gnupg

Class GnuPGDummyKeyUtil.Builder

  • Enclosing class:
    GnuPGDummyKeyUtil

    public static final class GnuPGDummyKeyUtil.Builder
    extends java.lang.Object
    • Method Detail

      • divertPrivateKeysToCard

        public org.bouncycastle.openpgp.PGPSecretKeyRing divertPrivateKeysToCard​(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​(GnuPGDummyKeyUtil.KeyFilter filter,
                                                                                 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