Package org.gnupg

# Class GnuPGDummyKeyUtil

java.lang.Object
org.gnupg.GnuPGDummyKeyUtil

public final class GnuPGDummyKeyUtil extends Object
This class can be used to remove private keys from secret software-keys by replacing them with stub secret keys in the style of GnuPGs proprietary extensions.

See Also:
  - GnuPGs doc/DETAILS - GNU extensions to the S2K algorithm

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`GnuPGDummyKeyUtil.Builder`
`static interface`
`GnuPGDummyKeyUtil.KeyFilter`
Filter for selecting keys.

## Method Summary

Modifier and Type
Method
Description
`static Set<SubkeyIdentifier>`
`getIdsOfKeysWithGnuPGS2KDivertedToCard(org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)`
Return the key-ids of all keys which appear to be stored on a hardware token / smartcard by GnuPG.
`static GnuPGDummyKeyUtil.Builder`
`modify(org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)`
Modify the given `PGPSecretKeyRing`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### getIdsOfKeysWithGnuPGS2KDivertedToCard

public static Set<SubkeyIdentifier> getIdsOfKeysWithGnuPGS2KDivertedToCard(@Nonnull org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
Return the key-ids of all keys which appear to be stored on a hardware token / smartcard by GnuPG. Note, that this functionality is based on GnuPGs proprietary S2K extensions, which are not strictly required for dealing with hardware-backed keys.

Parameters:
  `secretKeys` - secret keys
Returns:
  set of keys with S2K type GNU_DUMMY_S2K and protection mode DIVERT_TO_CARD

### modify

public static GnuPGDummyKeyUtil.Builder modify(@Nonnull org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
Modify the given `PGPSecretKeyRing`.

Parameters:
  `secretKeys` - secret keys
Returns:
  builder