package com.atlassian.bitbucket.mesh.auth;

import io.jsonwebtoken.security.SignatureException;

import javax.annotation.Nonnull;

import static java.util.Objects.requireNonNull;

public class MissingNodeKeyException extends SignatureException {

    private final String nodeId;
    private final String fingerprint;

    public MissingNodeKeyException(@Nonnull String nodeId, @Nonnull String fingerprint) {
        super("No signing key could be resolved for " + requireNonNull(nodeId, "nodeId") + " with " +
                "fingerprint " + requireNonNull(fingerprint, "fingerprint"));
        this.nodeId = nodeId;
        this.fingerprint = fingerprint;
    }

    @Nonnull
    public String getFingerprint() {
        return fingerprint;
    }

    @Nonnull
    public String getNodeId() {
        return nodeId;
    }
}