1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 18:59:39 +02:00

fix comments and javadoc

This commit is contained in:
Paul Schaub 2021-08-15 15:38:31 +02:00
parent c11f334fa4
commit 54a4625fed
5 changed files with 49 additions and 5 deletions

View file

@ -169,7 +169,6 @@ public class ConsumerOptions {
public ConsumerOptions setSessionKey(@Nonnull byte[] sessionKey) { public ConsumerOptions setSessionKey(@Nonnull byte[] sessionKey) {
this.sessionKey = sessionKey; this.sessionKey = sessionKey;
throw new NotYetImplementedException(); throw new NotYetImplementedException();
// return this;
} }
/** /**

View file

@ -56,42 +56,87 @@ public final class EncryptionResult {
this.fileEncoding = encoding; this.fileEncoding = encoding;
} }
/**
* Return the symmetric encryption algorithm used to encrypt the message.
* @return symmetric encryption algorithm
*
* @deprecated use {@link #getEncryptionAlgorithm()} instead.
*/
@Deprecated @Deprecated
public SymmetricKeyAlgorithm getSymmetricKeyAlgorithm() { public SymmetricKeyAlgorithm getSymmetricKeyAlgorithm() {
return getEncryptionAlgorithm(); return getEncryptionAlgorithm();
} }
/**
* Return the symmetric encryption algorithm used to encrypt the message.
*
* @return symmetric encryption algorithm
* */
public SymmetricKeyAlgorithm getEncryptionAlgorithm() { public SymmetricKeyAlgorithm getEncryptionAlgorithm() {
return encryptionAlgorithm; return encryptionAlgorithm;
} }
/**
* Return the compression algorithm that was used to compress the message before encryption/signing.
*
* @return compression algorithm
*/
public CompressionAlgorithm getCompressionAlgorithm() { public CompressionAlgorithm getCompressionAlgorithm() {
return compressionAlgorithm; return compressionAlgorithm;
} }
/**
* Return a {@link MultiMap} of key identifiers and detached signatures that were generated for the message.
* Each key of the map represents a signing key, which has one or more detached signatures associated with it.
*
* @return detached signatures
*/
public MultiMap<SubkeyIdentifier, PGPSignature> getDetachedSignatures() { public MultiMap<SubkeyIdentifier, PGPSignature> getDetachedSignatures() {
return detachedSignatures; return detachedSignatures;
} }
/**
* Return the set of recipient encryption keys.
*
* @return recipients
*/
public Set<SubkeyIdentifier> getRecipients() { public Set<SubkeyIdentifier> getRecipients() {
return recipients; return recipients;
} }
/** /**
* Return the file name of the encrypted/signed data.
* *
* @return filename
*/ */
public String getFileName() { public String getFileName() {
return fileName; return fileName;
} }
/**
* Return the modification date of the encrypted/signed file.
*
* @return modification date
*/
public Date getModificationDate() { public Date getModificationDate() {
return modificationDate; return modificationDate;
} }
/**
* Return the encoding format of the encrypted/signed data.
*
* @return encoding format
*/
public StreamEncoding getFileEncoding() { public StreamEncoding getFileEncoding() {
return fileEncoding; return fileEncoding;
} }
/**
* Return true, if the message is marked as for-your-eyes-only.
* This is typically done by setting the filename "_CONSOLE".
*
* @return is message for your eyes only?
*/
public static Builder builder() { public static Builder builder() {
return new Builder(); return new Builder();
} }

View file

@ -428,7 +428,7 @@ public final class Policy {
minimalBitStrengths.put(PublicKeyAlgorithm.RSA_GENERAL, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.RSA_GENERAL, 2000);
minimalBitStrengths.put(PublicKeyAlgorithm.RSA_SIGN, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.RSA_SIGN, 2000);
minimalBitStrengths.put(PublicKeyAlgorithm.RSA_ENCRYPT, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.RSA_ENCRYPT, 2000);
// TODO: ElGamal is not mentioned in the BSI document. // Note: ElGamal is not mentioned in the BSI document.
// We assume that the requirements are similar to other DH algorithms // We assume that the requirements are similar to other DH algorithms
minimalBitStrengths.put(PublicKeyAlgorithm.ELGAMAL_ENCRYPT, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.ELGAMAL_ENCRYPT, 2000);
minimalBitStrengths.put(PublicKeyAlgorithm.ELGAMAL_GENERAL, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.ELGAMAL_GENERAL, 2000);
@ -436,7 +436,7 @@ public final class Policy {
minimalBitStrengths.put(PublicKeyAlgorithm.DSA, 2000); minimalBitStrengths.put(PublicKeyAlgorithm.DSA, 2000);
// §5.4.3 // §5.4.3
minimalBitStrengths.put(PublicKeyAlgorithm.ECDSA, 250); minimalBitStrengths.put(PublicKeyAlgorithm.ECDSA, 250);
// TODO: EdDSA is not mentioned in the BSI document. // Note: EdDSA is not mentioned in the BSI document.
// We assume that the requirements are similar to other EC algorithms. // We assume that the requirements are similar to other EC algorithms.
minimalBitStrengths.put(PublicKeyAlgorithm.EDDSA, 250); minimalBitStrengths.put(PublicKeyAlgorithm.EDDSA, 250);
// §7.2.1 // §7.2.1
@ -451,7 +451,7 @@ public final class Policy {
/** /**
* Return the {@link NotationRegistry} of PGPainless. * Return the {@link NotationRegistry} of PGPainless.
* The notation registry is used to decide, whether or not a Notation is known or not. * The notation registry is used to decide, whether a Notation is known or not.
* Background: Critical unknown notations render signatures invalid. * Background: Critical unknown notations render signatures invalid.
* *
* @return Notation registry * @return Notation registry

View file

@ -92,6 +92,7 @@ public class DetachedSignature {
* Return the {@link OpenPgpV4Fingerprint} of the key that created the signature. * Return the {@link OpenPgpV4Fingerprint} of the key that created the signature.
* *
* @return fingerprint of the signing key * @return fingerprint of the signing key
* @deprecated use {@link #getSigningKeyIdentifier()} instead.
*/ */
@Deprecated @Deprecated
public OpenPgpV4Fingerprint getFingerprint() { public OpenPgpV4Fingerprint getFingerprint() {

View file

@ -479,7 +479,6 @@ public final class SignatureSubpacketsUtil {
/** /**
* Return the signatures exportable certification subpacket from the hashed area. * Return the signatures exportable certification subpacket from the hashed area.
* TODO: Can this packet also be placed in the unhashed area?
* *
* @param signature signature * @param signature signature
* @return exportable certification subpacket * @return exportable certification subpacket