Class Whitelist.PubRingSelectionStrategy<O>

  • Type Parameters:
    O - Type of identifier for PGPPublicKeyRingCollections.
    All Implemented Interfaces:
    KeyRingSelectionStrategy<org.bouncycastle.openpgp.PGPPublicKeyRing,​org.bouncycastle.openpgp.PGPPublicKeyRingCollection,​O>
    Enclosing class:
    Whitelist

    public static class Whitelist.PubRingSelectionStrategy<O>
    extends PublicKeyRingSelectionStrategy<O>
    KeyRingSelectionStrategy which accepts PGPPublicKeyRings 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

      • PubRingSelectionStrategy

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

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

      • accept

        public boolean accept​(O identifier,
                              org.bouncycastle.openpgp.PGPPublicKeyRing 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