Class SecretKeyRingSelectionStrategy<O>

java.lang.Object
org.pgpainless.util.selection.keyring.SecretKeyRingSelectionStrategy<O>
Type Parameters:
O - Type of identifier
All Implemented Interfaces:
KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPSecretKeyRing,org.bouncycastle.openpgp.PGPSecretKeyRingCollection,O>
Direct Known Subclasses:
ExactUserId.SecRingSelectionStrategy, Whitelist.SecRingSelectionStrategy, Wildcard.SecRingSelectionStrategy

public abstract class SecretKeyRingSelectionStrategy<O> extends Object implements KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPSecretKeyRing,org.bouncycastle.openpgp.PGPSecretKeyRingCollection,O>
Abstract KeyRingSelectionStrategy for PGPSecretKeyRings.
  • Constructor Details

    • SecretKeyRingSelectionStrategy

      public SecretKeyRingSelectionStrategy()
  • Method Details

    • selectKeyRingsFromCollection

      public Set<org.bouncycastle.openpgp.PGPSecretKeyRing> selectKeyRingsFromCollection(O identifier, @Nonnull org.bouncycastle.openpgp.PGPSecretKeyRingCollection keyRingCollection)
      Description copied from interface: KeyRingSelectionStrategy
      Iterate of the given
      keyRingCollection
      and return a Set of all acceptable keyRings in the collection, based on the given
      identifier
      .
      Specified by:
      selectKeyRingsFromCollection in interface KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPSecretKeyRing,org.bouncycastle.openpgp.PGPSecretKeyRingCollection,O>
      Parameters:
      identifier - identifier
      keyRingCollection - collection
      Returns:
      set of acceptable key rings
    • selectKeyRingsFromCollections

      public MultiMap<O,org.bouncycastle.openpgp.PGPSecretKeyRing> selectKeyRingsFromCollections(@Nonnull MultiMap<O,org.bouncycastle.openpgp.PGPSecretKeyRingCollection> keyRingCollections)
      Description copied from interface: KeyRingSelectionStrategy
      Iterate over all keyRings in the given MultiMap of keyRingCollections and return a new MultiMap which for every identifier (key of the map) contains all acceptable keyRings based on that identifier.
      Specified by:
      selectKeyRingsFromCollections in interface KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPSecretKeyRing,org.bouncycastle.openpgp.PGPSecretKeyRingCollection,O>
      Parameters:
      keyRingCollections - MultiMap of identifiers and keyRingCollections.
      Returns:
      MultiMap of identifiers and acceptable keyRings.