Package org.gnupg
Class GnuPGDummyKeyUtil.Builder
- java.lang.Object
-
- org.gnupg.GnuPGDummyKeyUtil.Builder
-
- Enclosing class:
- GnuPGDummyKeyUtil
public static final class GnuPGDummyKeyUtil.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.openpgp.PGPSecretKeyRing
divertPrivateKeysToCard(GnuPGDummyKeyUtil.KeyFilter filter)
Remove all private keys that match the givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.DIVERT_TO_CARD
.org.bouncycastle.openpgp.PGPSecretKeyRing
divertPrivateKeysToCard(GnuPGDummyKeyUtil.KeyFilter filter, byte[] cardSerialNumber)
Remove all private keys that match the givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.DIVERT_TO_CARD
.org.bouncycastle.openpgp.PGPSecretKeyRing
removePrivateKeys(GnuPGDummyKeyUtil.KeyFilter filter)
Remove all private keys that match the givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.NO_PRIVATE_KEY
.
-
-
-
Method Detail
-
removePrivateKeys
public org.bouncycastle.openpgp.PGPSecretKeyRing removePrivateKeys(@Nonnull GnuPGDummyKeyUtil.KeyFilter filter)
Remove all private keys that match the givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.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 givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.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 givenGnuPGDummyKeyUtil.KeyFilter
from the key ring and replace them with GNU_DUMMY keys with S2K protection modeGnuPGDummyExtension.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 removalcardSerialNumber
- serial number of the card (at most 16 bytes long)- Returns:
- modified key ring
-
-