wkd-java/wkd-java/src/main/java/pgp/wkd/RejectedCertificate.java

43 lines
1.1 KiB
Java
Raw Normal View History

2022-03-10 16:56:46 +01:00
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package pgp.wkd;
import pgp.certificate_store.certificate.Certificate;
2022-03-10 16:56:46 +01:00
2022-03-17 15:27:28 +01:00
/**
* A rejected OpenPGP certificate.
* The WKD specification requires that a certificate fetched via the Web Key Directory MUST contain the mail address
* that was used to look up the certificate as a user id.
*
* A rejected certificate may not have carried the lookup email address.
*/
2022-03-10 16:56:46 +01:00
public class RejectedCertificate {
private final Certificate certificate;
2022-03-17 15:27:28 +01:00
private final Throwable reasonForRejection;
2022-03-10 16:56:46 +01:00
2022-03-17 15:27:28 +01:00
public RejectedCertificate(Certificate certificate, Throwable reasonForRejection) {
2022-03-10 16:56:46 +01:00
this.certificate = certificate;
2022-03-17 15:27:28 +01:00
this.reasonForRejection = reasonForRejection;
2022-03-10 16:56:46 +01:00
}
2022-03-17 15:27:28 +01:00
/**
* Return the certificate.
* @return certificate
*/
2022-03-10 16:56:46 +01:00
public Certificate getCertificate() {
return certificate;
}
2022-03-17 15:27:28 +01:00
/**
* Return the reason for rejection.
* @return rejection reason
*/
public Throwable getReasonForRejection() {
return reasonForRejection;
2022-03-10 16:56:46 +01:00
}
}