Fix javadoc warnings

This commit is contained in:
Paul Schaub 2022-04-29 16:31:49 +02:00
parent ce1469948f
commit 27d48824b3
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
7 changed files with 47 additions and 5 deletions

View File

@ -5,10 +5,9 @@ SPDX-License-Identifier: CC0-1.0
# Cert-D-Java Changelog # Cert-D-Java Changelog
## 0.1.1-SNAPSHOT ## 0.1.1
- Bump `slf4j` to `1.7.36` - Bump `slf4j` to `1.7.36`
- Bump `logback` to `1.2.11` - Bump `logback` to `1.2.11`
-
## 0.1.0 ## 0.1.0
- Initial Release - Initial Release

View File

@ -28,7 +28,8 @@ public class FilenameResolver {
* *
* @param fingerprint fingerprint * @param fingerprint fingerprint
* @return absolute certificate file location * @return absolute certificate file location
* @throws BadNameException *
* @throws BadNameException if the given fingerprint string is not a fingerprint
*/ */
public File getCertFileByFingerprint(String fingerprint) throws BadNameException { public File getCertFileByFingerprint(String fingerprint) throws BadNameException {
if (!isFingerprint(fingerprint)) { if (!isFingerprint(fingerprint)) {
@ -41,6 +42,15 @@ public class FilenameResolver {
return file; return file;
} }
/**
* Calculate the file location for the certification addressed using the given special name.
* For known special names, see {@link SpecialNames}.
*
* @param specialName special name (e.g. "trust-root")
* @return absolute certificate file location
*
* @throws BadNameException in case the given special name is not known
*/
public File getCertFileBySpecialName(String specialName) throws BadNameException { public File getCertFileBySpecialName(String specialName) throws BadNameException {
if (!isSpecialName(specialName)) { if (!isSpecialName(specialName)) {
throw new BadNameException(); throw new BadNameException();

View File

@ -11,6 +11,9 @@ public interface LockingMechanism {
/** /**
* Lock the store for writes. * Lock the store for writes.
* Readers can continue to use the store and will always see consistent certs. * Readers can continue to use the store and will always see consistent certs.
*
* @throws IOException in case of an IO error
* @throws InterruptedException if the thread gets interrupted
*/ */
void lockDirectory() throws IOException, InterruptedException; void lockDirectory() throws IOException, InterruptedException;
@ -19,11 +22,15 @@ public interface LockingMechanism {
* Return false without locking the store in case the store was already locked. * Return false without locking the store in case the store was already locked.
* *
* @return true if locking succeeded, false otherwise * @return true if locking succeeded, false otherwise
*
* @throws IOException in case of an IO error
*/ */
boolean tryLockDirectory() throws IOException; boolean tryLockDirectory() throws IOException;
/** /**
* Release the directory write-lock acquired via {@link #lockDirectory()}. * Release the directory write-lock acquired via {@link #lockDirectory()}.
*
* @throws IOException in case of an IO error
*/ */
void releaseDirectory() throws IOException; void releaseDirectory() throws IOException;

View File

@ -21,6 +21,7 @@ public abstract class Certificate {
* Return an {@link InputStream} of the binary representation of the certificate. * Return an {@link InputStream} of the binary representation of the certificate.
* *
* @return input stream * @return input stream
* @throws IOException in case of an IO error
*/ */
public abstract InputStream getInputStream() throws IOException; public abstract InputStream getInputStream() throws IOException;
@ -29,8 +30,15 @@ public abstract class Certificate {
* The tag is a checksum calculated over the binary representation of the certificate. * The tag is a checksum calculated over the binary representation of the certificate.
* *
* @return tag * @return tag
* @throws IOException in case of an IO error
*/ */
public abstract String getTag() throws IOException; public abstract String getTag() throws IOException;
/**
* Return a {@link Set} containing key-ids of subkeys.
*
* @return subkeys
* @throws IOException in case of an IO error
*/
public abstract Set<Long> getSubkeyIds() throws IOException; public abstract Set<Long> getSubkeyIds() throws IOException;
} }

View File

@ -30,6 +30,8 @@ public interface CertificateDirectory {
* @return certificate or null * @return certificate or null
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws BadNameException if the identifier is invalid
* @throws BadDataException if the certificate file contains invalid data
*/ */
Certificate getCertificate(String identifier) Certificate getCertificate(String identifier)
throws IOException, BadNameException, BadDataException; throws IOException, BadNameException, BadDataException;
@ -44,6 +46,8 @@ public interface CertificateDirectory {
* @return changed certificate or null * @return changed certificate or null
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws BadNameException if the identifier is invalid
* @throws BadDataException if the certificate file contains invalid data
*/ */
Certificate getCertificateIfChanged(String identifier, String tag) Certificate getCertificateIfChanged(String identifier, String tag)
throws IOException, BadNameException, BadDataException; throws IOException, BadNameException, BadDataException;
@ -63,6 +67,7 @@ public interface CertificateDirectory {
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws InterruptedException in case the inserting thread gets interrupted * @throws InterruptedException in case the inserting thread gets interrupted
* @throws BadDataException if the data stream does not contain valid OpenPGP data
*/ */
Certificate insertCertificate(InputStream data, MergeCallback merge) Certificate insertCertificate(InputStream data, MergeCallback merge)
throws IOException, InterruptedException, BadDataException; throws IOException, InterruptedException, BadDataException;
@ -83,6 +88,7 @@ public interface CertificateDirectory {
* @return merged certificate or null if the store cannot be locked * @return merged certificate or null if the store cannot be locked
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws BadDataException if the data stream does not contain valid OpenPGP data
*/ */
Certificate tryInsertCertificate(InputStream data, MergeCallback merge) Certificate tryInsertCertificate(InputStream data, MergeCallback merge)
throws IOException, BadDataException; throws IOException, BadDataException;
@ -98,11 +104,15 @@ public interface CertificateDirectory {
* This method will block until a write-lock on the store can be acquired. If you cannot afford blocking, * This method will block until a write-lock on the store can be acquired. If you cannot afford blocking,
* consider to use {@link #tryInsertCertificateBySpecialName(String, InputStream, MergeCallback)} instead. * consider to use {@link #tryInsertCertificateBySpecialName(String, InputStream, MergeCallback)} instead.
* *
* @param specialName special name of the certificate
* @param data input stream containing the new certificate instance * @param data input stream containing the new certificate instance
* @param merge callback for merging with an existing certificate instance * @param merge callback for merging with an existing certificate instance
* @return merged certificate or null if the store cannot be locked * @return merged certificate or null if the store cannot be locked
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws InterruptedException if the thread is interrupted
* @throws BadDataException if the certificate file does not contain valid OpenPGP data
* @throws BadNameException if the special name is unknown
*/ */
Certificate insertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge) Certificate insertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge)
throws IOException, InterruptedException, BadDataException, BadNameException; throws IOException, InterruptedException, BadDataException, BadNameException;
@ -120,11 +130,14 @@ public interface CertificateDirectory {
* However, if the write-lock is available, this method will acquire the lock, write to the store, release the lock * However, if the write-lock is available, this method will acquire the lock, write to the store, release the lock
* and return the written certificate. * and return the written certificate.
* *
* @param specialName special name for the certificate
* @param data input stream containing the new certificate instance * @param data input stream containing the new certificate instance
* @param merge callback for merging with an existing certificate instance * @param merge callback for merging with an existing certificate instance
* @return merged certificate or null if the store cannot be locked * @return merged certificate or null if the store cannot be locked
* *
* @throws IOException in case of an IO-error * @throws IOException in case of an IO-error
* @throws BadDataException if the data stream does not contain valid OpenPGP data
* @throws BadNameException if the special name is not known
*/ */
Certificate tryInsertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge) Certificate tryInsertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge)
throws IOException, BadDataException, BadNameException; throws IOException, BadDataException, BadNameException;

View File

@ -19,6 +19,8 @@ public interface MergeCallback {
* @param data certificate * @param data certificate
* @param existing optional already existing copy of the certificate * @param existing optional already existing copy of the certificate
* @return merged certificate * @return merged certificate
*
* @throws IOException in case of an IO error
*/ */
Certificate merge(Certificate data, Certificate existing) throws IOException; Certificate merge(Certificate data, Certificate existing) throws IOException;

View File

@ -16,6 +16,8 @@ public interface SubkeyLookup {
* *
* @param subkeyId subkey id * @param subkeyId subkey id
* @return fingerprint of the certificate * @return fingerprint of the certificate
*
* @throws IOException in case of an IO error
*/ */
Set<String> getCertificateFingerprintsForSubkeyId(long subkeyId) throws IOException; Set<String> getCertificateFingerprintsForSubkeyId(long subkeyId) throws IOException;
@ -25,6 +27,7 @@ public interface SubkeyLookup {
* *
* @param certificate certificate fingerprint * @param certificate certificate fingerprint
* @param subkeyIds subkey ids * @param subkeyIds subkey ids
*
* @throws IOException in case of an IO error * @throws IOException in case of an IO error
*/ */
void storeCertificateSubkeyIds(String certificate, List<Long> subkeyIds) throws IOException; void storeCertificateSubkeyIds(String certificate, List<Long> subkeyIds) throws IOException;