diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/algorithm/PublicKeyAlgorithm.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/algorithm/PublicKeyAlgorithm.kt index 075316ed..a5da51b5 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/algorithm/PublicKeyAlgorithm.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/algorithm/PublicKeyAlgorithm.kt @@ -25,8 +25,7 @@ enum class PublicKeyAlgorithm(val algorithmId: Int) { /** * RSA with usage encryption. * - * @deprecated see Deprecation - * notice + * @deprecated see [Deprecation notice](https://tools.ietf.org/html/rfc4880#section-13.5) */ @Deprecated("RSA_ENCRYPT is deprecated in favor of RSA_GENERAL", ReplaceWith("RSA_GENERAL")) RSA_ENCRYPT(2), @@ -34,8 +33,7 @@ enum class PublicKeyAlgorithm(val algorithmId: Int) { /** * RSA with usage of creating signatures. * - * @deprecated see Deprecation - * notice + * @deprecated see [Deprecation notice](https://tools.ietf.org/html/rfc4880#section-13.5) */ @Deprecated("RSA_SIGN is deprecated in favor of RSA_GENERAL", ReplaceWith("RSA_GENERAL")) RSA_SIGN(3), @@ -55,8 +53,7 @@ enum class PublicKeyAlgorithm(val algorithmId: Int) { /** * ElGamal General. * - * @deprecated see Deprecation - * notice + * @deprecated see [Deprecation notice](https://tools.ietf.org/html/rfc4880#section-13.8) */ @Deprecated("ElGamal is deprecated") ELGAMAL_GENERAL(20), diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageMetadata.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageMetadata.kt index 8e257a23..4e0260c1 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageMetadata.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/decryption_verification/MessageMetadata.kt @@ -337,8 +337,7 @@ class MessageMetadata(val message: Message) { * decrypted file under its original filename, but since this field is not necessarily part of * the signed data of a message, usage of this field is discouraged. * - * @see RFC4880 §5.9. Literal Data - * Packet + * @see [RFC4880 §5.9. Literal Data Packet](https://www.rfc-editor.org/rfc/rfc4880#section-5.9) */ val filename: String? = findLiteralData()?.fileName @@ -355,8 +354,7 @@ class MessageMetadata(val message: Message) { * the modification date of a decrypted file, but since this field is not necessarily part of * the signed data, its use is discouraged. * - * @see RFC4880 §5.9. Literal Data - * Packet + * @see [RFC4880 §5.9. Literal Data Packet](https://www.rfc-editor.org/rfc/rfc4880#section-5.9) */ val modificationDate: Date? = findLiteralData()?.modificationDate @@ -365,8 +363,7 @@ class MessageMetadata(val message: Message) { * binary data, ...) the data has. Since this field is not necessarily part of the signed data * of a message, its usage is discouraged. * - * @see RFC4880 §5.9. Literal Data - * Packet + * @see [RFC4880 §5.9. Literal Data Packet](https://www.rfc-editor.org/rfc/rfc4880#section-5.9) */ val literalDataEncoding: StreamEncoding? = findLiteralData()?.format @@ -459,8 +456,8 @@ class MessageMetadata(val message: Message) { * Outermost OpenPGP Message structure. * * @param cleartextSigned whether the message is using the Cleartext Signature Framework - * @see RFC4880 §7. Cleartext - * Signature Framework + * @see + * [RFC4880 §7. Cleartext Signature Framework](https://www.rfc-editor.org/rfc/rfc4880#section-7) */ class Message(var cleartextSigned: Boolean = false) : Layer(0) { fun setCleartextSigned() = apply { cleartextSigned = true } @@ -499,7 +496,7 @@ class MessageMetadata(val message: Message) { /** * Encrypted Data. * - * @param algorithm symmetric key algorithm used to encrypt the packet. + * @param mechanism mechanism used to encrypt the packet. * @param depth nesting depth at which this packet was encountered. */ class EncryptedData(val mechanism: MessageEncryptionMechanism, depth: Int) : diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/EncryptionStream.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/EncryptionStream.kt index d2a9a63c..9ccbfc10 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/EncryptionStream.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/EncryptionStream.kt @@ -30,10 +30,10 @@ const val BUFFER_SIZE = 1 shl 9 * OutputStream that produces an OpenPGP message. The message can be encrypted, signed, or both, * depending on its configuration. * - * This class is based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream. + * This class was originally based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream. * - * @see Source + * @see + * [PGPEncryptingStream](https://github.com/neuhalje/bouncy-gpg/blob/master/src/main/java/name/neuhalfen/projects/crypto/bouncycastle/openpgp/encrypting/PGPEncryptingStream.java) */ class EncryptionStream( private var outermostStream: OutputStream, diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/ProducerOptions.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/ProducerOptions.kt index b58c6e78..e2c4596f 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/ProducerOptions.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/encryption_signing/ProducerOptions.kt @@ -180,8 +180,8 @@ class ProducerOptions( * * @param encoding encoding * @return this - * @see RFC4880 §5.9. - * Literal Data Packet + * @see + * [RFC4880 §5.9. Literal Data Packet](https://datatracker.ietf.org/doc/html/rfc4880#section-5.9) * @deprecated options other than the default value of [StreamEncoding.BINARY] are discouraged. */ @Deprecated("Options other than BINARY are discouraged.") diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/key/OpenPgpFingerprint.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/key/OpenPgpFingerprint.kt index d4925252..7508ca77 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/key/OpenPgpFingerprint.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/key/OpenPgpFingerprint.kt @@ -32,8 +32,8 @@ abstract class OpenPgpFingerprint : CharSequence, Comparable * fingerprint, but we don't care, since V3 is deprecated. * * @return key id - * @see RFC-4880 §12.2: Key IDs and - * Fingerprints + * @see + * [RFC-4880 §12.2: Key IDs and Fingerprints](https://tools.ietf.org/html/rfc4880#section-12.2) */ abstract val keyId: Long diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/KeyRingProtectionSettings.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/KeyRingProtectionSettings.kt index e9cdb973..b6c0e492 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/KeyRingProtectionSettings.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/KeyRingProtectionSettings.kt @@ -14,7 +14,7 @@ import org.pgpainless.algorithm.SymmetricKeyAlgorithm * @param encryptionAlgorithm encryption algorithm * @param hashAlgorithm hash algorithm * @param s2kCount encoded (!) s2k iteration count - * @see Encoding Formula + * @see [Encoding Formula](https://www.rfc-editor.org/rfc/rfc4880#section-3.7.1.3) */ data class KeyRingProtectionSettings( val encryptionAlgorithm: SymmetricKeyAlgorithm, diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/fixes/S2KUsageFix.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/fixes/S2KUsageFix.kt index b7447af7..fee9047f 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/fixes/S2KUsageFix.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/fixes/S2KUsageFix.kt @@ -19,11 +19,9 @@ import org.pgpainless.key.protection.fixes.S2KUsageFix.Companion.replaceUsageChe * method [replaceUsageChecksumWithUsageSha1] ensures that such keys are encrypted using S2K usage * [SecretKeyPacket.USAGE_SHA1] instead. * - * @see Related PGPainless Bug - * Report - * @see Related PGPainless Feature - * Request - * @see Related upstream BC bug report + * @see [Related PGPainless Bug Report](https://github.com/pgpainless/pgpainless/issues/176) + * @see [Related PGPainless Feature Request](https://github.com/pgpainless/pgpainless/issues/178) + * @see [Related upstream BC bug report](https://github.com/bcgit/bc-java/issues/1020) */ class S2KUsageFix { @@ -39,7 +37,6 @@ class S2KUsageFix { * @param skipKeysWithMissingPassphrase if set to true, missing subkey passphrases will * cause the subkey to stay unaffected. * @return fixed key ring - * @throws PGPException in case of a PGP error. */ @JvmStatic @JvmOverloads diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/key/util/PublicKeyParameterValidationUtil.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/key/util/PublicKeyParameterValidationUtil.kt index fa91b1aa..130e12ff 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/key/util/PublicKeyParameterValidationUtil.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/key/util/PublicKeyParameterValidationUtil.kt @@ -24,7 +24,7 @@ import org.pgpainless.exception.KeyIntegrityException * modified public key in combination with the unmodified secret key material can then lead to the * extraction of secret key parameters via weakly crafted messages. * - * @see Key Overwriting (KO) Attacks against OpenPGP + * @see [Key Overwriting (KO) Attacks against OpenPGP](https://www.kopenpgp.com/) */ class PublicKeyParameterValidationUtil { @@ -153,13 +153,13 @@ class PublicKeyParameterValidationUtil { /** * Validate ElGamal public key parameters. * - * Original implementation by the openpgpjs authors: RFC5322 §3.4. Address - * Specification + * @see + * [RFC5322 §3.4. Address Specification](https://www.rfc-editor.org/rfc/rfc5322#page-16) */ @JvmStatic fun parse(string: String): UserId { diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/policy/Policy.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/policy/Policy.kt index 46dab518..9b23074f 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/policy/Policy.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/policy/Policy.kt @@ -354,12 +354,10 @@ class Policy( * problems to have a strength of at least 2000 bits. * * @return default algorithm policy - * @see BSI - - * Technical Guideline - Cryptographic Mechanisms: Recommendations and Key Lengths - * (2021-01) - * @see BlueKrypt | Cryptographic Key Length - * Recommendation + * @see + * [BSI - Technical Guideline - Cryptographic Mechanisms: Recommendations and Key Lengths (2021-01)](https://www.bsi.bund.de/SharedDocs/Downloads/EN/BSI/Publications/TechGuidelines/TG02102/BSI-TR-02102-1.pdf) + * @see + * [BlueKrypt | Cryptographic Key Length Recommendation](https://www.keylength.com/) */ @JvmStatic fun bsi2021PublicKeyAlgorithmPolicy() = diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/util/ArmorUtils.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/util/ArmorUtils.kt index a1e3c46e..1e37c8f0 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/util/ArmorUtils.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/util/ArmorUtils.kt @@ -282,8 +282,8 @@ class ArmorUtils { * * @param armor armored output stream * @param hashAlgorithm hash algorithm - * @see RFC 4880 - - * OpenPGP Message Format §6.2. Forming ASCII Armor + * @see + * [RFC 4880 - OpenPGP Message Format §6.2. Forming ASCII Armor](https://datatracker.ietf.org/doc/html/rfc4880#section-6.2) */ @JvmStatic @Deprecated( @@ -297,8 +297,8 @@ class ArmorUtils { * * @param armor armored output stream * @param comment free-text comment - * @see RFC 4880 - - * OpenPGP Message Format §6.2. Forming ASCII Armor + * @see + * [RFC 4880 - OpenPGP Message Format §6.2. Forming ASCII Armor](https://datatracker.ietf.org/doc/html/rfc4880#section-6.2) */ @JvmStatic @Deprecated( @@ -312,8 +312,8 @@ class ArmorUtils { * * @param armor armored output stream * @param messageId message id - * @see RFC 4880 - - * OpenPGP Message Format §6.2. Forming ASCII Armor + * @see + * [RFC 4880 - OpenPGP Message Format §6.2. Forming ASCII Armor](https://datatracker.ietf.org/doc/html/rfc4880#section-6.2) */ @JvmStatic @Deprecated(