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;
|
|
|
|
|
2022-11-25 16:17:24 +01:00
|
|
|
import pgp.certificate_store.certificate.Certificate;
|
2022-03-10 16:56:46 +01:00
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
2022-03-17 15:27:28 +01:00
|
|
|
/**
|
|
|
|
* Tuple class which bundles a {@link Certificate} and a list of its valid or expired user ids.
|
|
|
|
*/
|
2022-03-10 16:56:46 +01:00
|
|
|
public class CertificateAndUserIds {
|
|
|
|
|
|
|
|
private final Certificate certificate;
|
|
|
|
private final List<String> userIds;
|
2022-03-17 15:31:39 +01:00
|
|
|
|
2022-03-10 16:56:46 +01:00
|
|
|
public CertificateAndUserIds(Certificate certificate, List<String> userIds) {
|
|
|
|
this.certificate = certificate;
|
|
|
|
this.userIds = userIds;
|
|
|
|
}
|
|
|
|
|
2022-03-17 15:27:28 +01:00
|
|
|
/**
|
|
|
|
* Return a list containing the valid or expired user-ids of the certificate.
|
|
|
|
*
|
|
|
|
* @return user ids
|
|
|
|
*/
|
2022-03-10 16:56:46 +01:00
|
|
|
public List<String> getUserIds() {
|
|
|
|
return new ArrayList<>(userIds);
|
|
|
|
}
|
|
|
|
|
2022-03-17 15:27:28 +01:00
|
|
|
/**
|
|
|
|
* Return the certificate itself.
|
|
|
|
*
|
|
|
|
* @return certificate
|
|
|
|
*/
|
2022-03-10 16:56:46 +01:00
|
|
|
public Certificate getCertificate() {
|
|
|
|
return certificate;
|
|
|
|
}
|
|
|
|
}
|