// Path: src/main/java/org/simplify4u/plugins/pgp/KeyInfo.java
// @Builder
// @Value
// public class KeyInfo {
// 
//     @NonNull
//     KeyFingerprint fingerprint;
// 
//     KeyFingerprint master;
// 
//     Collection<String> uids;
// 
//     int version;
//     int algorithm;
// 
//     int bits;
// 
//     Date date;
// }


import org.apache.maven.artifact.Artifact;
import org.codehaus.plexus.resource.ResourceManager;
import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
import org.simplify4u.plugins.pgp.KeyInfo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Named;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
     * @param artifact artifact to test
     *
     * @return key missing status
     */
    public boolean isKeyMissing(Artifact artifact) {

        ArtifactData artifactData = new ArtifactData(artifact);

        return items.entrySet().stream()
                .filter(entry -> entry.getKey().isMatch(artifactData))
                .anyMatch(entry -> entry.getValue().isKeyMissing());
    }

    public boolean isWithKey(Artifact artifact) {

        ArtifactData artifactData = new ArtifactData(artifact);

        return items.entrySet().stream()
                .filter(entry -> entry.getKey().isMatch(artifactData))
                .anyMatch(entry -> !entry.getValue().isNoSignature());
    }

    /**
     * Test if given key is trust for artifact.
     *
     * @param artifact a artifact
     * @param keyInfo  a key which is used to sign artifact
     *
     * @return a key trust status
     */
// Path: src/main/java/org/simplify4u/plugins/pgp/KeyInfo.java
// @Builder
// @Value
// public class KeyInfo {
// 
//     @NonNull
//     KeyFingerprint fingerprint;
// 
//     KeyFingerprint master;
// 
//     Collection<String> uids;
// 
//     int version;
//     int algorithm;
// 
//     int bits;
// 
//     Date date;
// }


// Path: src/main/java/org/simplify4u/plugins/keysmap/KeysMap.java
import org.apache.maven.artifact.Artifact;
import org.codehaus.plexus.resource.ResourceManager;
import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
import org.simplify4u.plugins.pgp.KeyInfo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.inject.Named;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;

     * @param artifact artifact to test
     *
     * @return key missing status
     */
    public boolean isKeyMissing(Artifact artifact) {

        ArtifactData artifactData = new ArtifactData(artifact);

        return items.entrySet().stream()
                .filter(entry -> entry.getKey().isMatch(artifactData))
                .anyMatch(entry -> entry.getValue().isKeyMissing());
    }

    public boolean isWithKey(Artifact artifact) {

        ArtifactData artifactData = new ArtifactData(artifact);

        return items.entrySet().stream()
                .filter(entry -> entry.getKey().isMatch(artifactData))
                .anyMatch(entry -> !entry.getValue().isNoSignature());
    }

    /**
     * Test if given key is trust for artifact.
     *
     * @param artifact a artifact
     * @param keyInfo  a key which is used to sign artifact
     *
     * @return a key trust status
     */
    public boolean isValidKey(Artifact artifact, KeyInfo keyInfo) {