001// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
002//
003// SPDX-License-Identifier: Apache-2.0
004
005package org.pgpainless.exception;
006
007import java.util.Arrays;
008import java.util.Collections;
009import java.util.Set;
010
011import org.bouncycastle.openpgp.PGPException;
012import org.pgpainless.key.SubkeyIdentifier;
013
014public class MissingPassphraseException extends PGPException {
015
016    private final Set<SubkeyIdentifier> keyIds;
017
018    public MissingPassphraseException(Set<SubkeyIdentifier> keyIds) {
019        super("Missing passphrase encountered for keys " + Arrays.toString(keyIds.toArray()));
020        this.keyIds = Collections.unmodifiableSet(keyIds);
021    }
022
023    public Set<SubkeyIdentifier> getKeyIds() {
024        return keyIds;
025    }
026}