Class 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 Detail

      • SecRingSelectionStrategy

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

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

      • 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