Package org.pgpainless.util.selection.keyring.impl

# 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 Summary

Constructors
Constructor
Description
`SecRingSelectionStrategy(Map<O,Set<Long>> whitelist)`
`SecRingSelectionStrategy(MultiMap<O,Long> whitelist)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`accept(O identifier, org.bouncycastle.openpgp.PGPSecretKeyRing keyRing)`
Return true, if the filter accepts the given

### Methods inherited from class org.pgpainless.util.selection.keyring.SecretKeyRingSelectionStrategy

`selectKeyRingsFromCollection, selectKeyRingsFromCollections`

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

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

## 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