Class Whitelist.SecRingSelectionStrategy<O>

java.lang.Object
org.pgpainless.util.selection.keyring.SecretKeyRingSelectionStrategy<O>
org.pgpainless.util.selection.keyring.impl.Whitelist.SecRingSelectionStrategy<O>
Type Parameters:
O - Type of identifier for PGPSecretKeyRingCollections.
All Implemented Interfaces:
KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPSecretKeyRing,org.bouncycastle.openpgp.PGPSecretKeyRingCollection,O>
Enclosing class:
Whitelist

public static class Whitelist.SecRingSelectionStrategy<O> extends SecretKeyRingSelectionStrategy<O>
KeyRingSelectionStrategy which accepts PGPSecretKeyRings if the
whitelist
contains their primary key id. If the whitelist contains 123L for "alice@pgpainless.org", the key with primary key id 123L is acceptable for "alice@pgpainless.org".
  • Constructor Details

    • SecRingSelectionStrategy

      public SecRingSelectionStrategy(MultiMap<O,Long> whitelist)
    • SecRingSelectionStrategy

      public SecRingSelectionStrategy(Map<O,Set<Long>> whitelist)
  • Method Details

    • accept

      public boolean accept(O identifier, org.bouncycastle.openpgp.PGPSecretKeyRing keyRing)
      Description copied from interface: KeyRingSelectionStrategy
      Return true, if the filter accepts the given
      keyRing
      based on the given
      identifier
      .
      Parameters:
      identifier - identifier
      keyRing - key ring
      Returns:
      acceptance