cert-d-java/pgp-certificate-store/src/main/java/pgp/certificate_store/Certificate.java

41 lines
1.1 KiB
Java
Raw Normal View History

2022-03-01 15:19:01 +01:00
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package pgp.certificate_store;
import java.io.IOException;
import java.io.InputStream;
import java.util.Set;
2022-07-04 19:42:02 +02:00
/**
* OpenPGP certificate (public key).
*/
public abstract class Certificate implements KeyMaterial {
2022-03-01 15:19:01 +01:00
/**
* Return an {@link InputStream} of the binary representation of the certificate.
*
* @return input stream
2022-04-29 16:31:49 +02:00
* @throws IOException in case of an IO error
2022-03-01 15:19:01 +01:00
*/
public abstract InputStream getInputStream() throws IOException;
/**
* Return a tag of the certificate.
* The tag is a checksum calculated over the binary representation of the certificate.
*
* @return tag
2022-04-29 16:31:49 +02:00
* @throws IOException in case of an IO error
2022-03-01 15:19:01 +01:00
*/
public abstract String getTag() throws IOException;
2022-04-29 16:31:49 +02:00
/**
* Return a {@link Set} containing key-ids of subkeys.
*
* @return subkeys
* @throws IOException in case of an IO error
*/
2022-03-01 15:19:01 +01:00
public abstract Set<Long> getSubkeyIds() throws IOException;
}