diff --git a/core/src/main/java/org/bouncycastle/asn1/BERBitStringParser.java b/core/src/main/java/org/bouncycastle/asn1/BERBitStringParser.java index 9b2cfaffc2..c9c1855647 100644 --- a/core/src/main/java/org/bouncycastle/asn1/BERBitStringParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/BERBitStringParser.java @@ -10,6 +10,7 @@ * * @deprecated Check for 'ASN1BitStringParser' instead */ +@Deprecated public class BERBitStringParser implements ASN1BitStringParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/BEROctetStringParser.java b/core/src/main/java/org/bouncycastle/asn1/BEROctetStringParser.java index bce7f0189c..c42a46aa42 100644 --- a/core/src/main/java/org/bouncycastle/asn1/BEROctetStringParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/BEROctetStringParser.java @@ -10,6 +10,7 @@ * * @deprecated Check for 'ASN1OctetStringParser' instead */ +@Deprecated public class BEROctetStringParser implements ASN1OctetStringParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/BERSequenceParser.java b/core/src/main/java/org/bouncycastle/asn1/BERSequenceParser.java index c53b0014ed..7f14a80703 100644 --- a/core/src/main/java/org/bouncycastle/asn1/BERSequenceParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/BERSequenceParser.java @@ -7,6 +7,7 @@ * * @deprecated Check for 'ASN1SequenceParser' instead */ +@Deprecated public class BERSequenceParser implements ASN1SequenceParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/BERSetParser.java b/core/src/main/java/org/bouncycastle/asn1/BERSetParser.java index cc369dfcb9..8cb392fd9e 100644 --- a/core/src/main/java/org/bouncycastle/asn1/BERSetParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/BERSetParser.java @@ -7,6 +7,7 @@ * * @deprecated Check for 'ASN1SetParser' instead */ +@Deprecated public class BERSetParser implements ASN1SetParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/DERExternal.java b/core/src/main/java/org/bouncycastle/asn1/DERExternal.java index fced6d2bac..a075b20aee 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DERExternal.java +++ b/core/src/main/java/org/bouncycastle/asn1/DERExternal.java @@ -20,6 +20,7 @@ public class DERExternal * * @deprecated Use {@link DERExternal#DERExternal(DERSequence)} instead. */ + @Deprecated public DERExternal(ASN1EncodableVector vector) { this(DERFactory.createSequence(vector)); diff --git a/core/src/main/java/org/bouncycastle/asn1/DEROctetStringParser.java b/core/src/main/java/org/bouncycastle/asn1/DEROctetStringParser.java index 33e1bca3da..7c537e5e0a 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DEROctetStringParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/DEROctetStringParser.java @@ -8,6 +8,7 @@ * * @deprecated Check for 'ASN1OctetStringParser' instead */ +@Deprecated public class DEROctetStringParser implements ASN1OctetStringParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/DLBitStringParser.java b/core/src/main/java/org/bouncycastle/asn1/DLBitStringParser.java index ce92398ebc..c4f4984bd9 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DLBitStringParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/DLBitStringParser.java @@ -8,6 +8,7 @@ * * @deprecated Check for 'ASN1BitStringParser' instead */ +@Deprecated public class DLBitStringParser implements ASN1BitStringParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/DLExternal.java b/core/src/main/java/org/bouncycastle/asn1/DLExternal.java index 8424fc50d0..2b7c814d2a 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DLExternal.java +++ b/core/src/main/java/org/bouncycastle/asn1/DLExternal.java @@ -20,6 +20,7 @@ public class DLExternal * * @deprecated Use {@link DLExternal#DLExternal(DLSequence)} instead. */ + @Deprecated public DLExternal(ASN1EncodableVector vector) { this(DLFactory.createSequence(vector)); diff --git a/core/src/main/java/org/bouncycastle/asn1/DLSequenceParser.java b/core/src/main/java/org/bouncycastle/asn1/DLSequenceParser.java index 83d1a2c047..a5da9346e3 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DLSequenceParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/DLSequenceParser.java @@ -7,6 +7,7 @@ * * @deprecated Check for 'ASN1SequenceParser' instead */ +@Deprecated public class DLSequenceParser implements ASN1SequenceParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/DLSetParser.java b/core/src/main/java/org/bouncycastle/asn1/DLSetParser.java index 4809f70194..f47357727b 100644 --- a/core/src/main/java/org/bouncycastle/asn1/DLSetParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/DLSetParser.java @@ -7,6 +7,7 @@ * * @deprecated Check for 'ASN1SetParser' instead */ +@Deprecated public class DLSetParser implements ASN1SetParser { diff --git a/core/src/main/java/org/bouncycastle/asn1/pkcs/PKCSObjectIdentifiers.java b/core/src/main/java/org/bouncycastle/asn1/pkcs/PKCSObjectIdentifiers.java index ab1d5d25ba..916356a643 100644 --- a/core/src/main/java/org/bouncycastle/asn1/pkcs/PKCSObjectIdentifiers.java +++ b/core/src/main/java/org/bouncycastle/asn1/pkcs/PKCSObjectIdentifiers.java @@ -195,6 +195,7 @@ public interface PKCSObjectIdentifiers /** PKCS#9: 1.2.840.113549.1.9.22.1 * @deprecated use x509Certificate instead */ + @Deprecated ASN1ObjectIdentifier x509certType = pkcs_9.branch("22.1"); /** PKCS#9: 1.2.840.113549.1.9.22 */ @@ -246,6 +247,7 @@ public interface PKCSObjectIdentifiers /** S/MIME: Algorithm Identifiers ; 1.2.840.113549.1.9.16.3 */ ASN1ObjectIdentifier smime_alg = id_smime.branch("3"); /** @deprecated use smime_alg instead */ + @Deprecated ASN1ObjectIdentifier id_alg = id_smime.branch("3"); /** PKCS#9: 1.2.840.113549.1.9.16.3.5 */ @@ -417,12 +419,16 @@ public interface PKCSObjectIdentifiers ASN1ObjectIdentifier id_aa_communityIdentifiers = id_aa.branch("40"); /** @deprecated use id_aa_ets_sigPolicyId instead */ + @Deprecated ASN1ObjectIdentifier id_aa_sigPolicyId = id_aa_ets_sigPolicyId; /** @deprecated use id_aa_ets_commitmentType instead */ + @Deprecated ASN1ObjectIdentifier id_aa_commitmentType = id_aa_ets_commitmentType; /** @deprecated use id_aa_ets_signerLocation instead */ + @Deprecated ASN1ObjectIdentifier id_aa_signerLocation = id_aa_ets_signerLocation; /** @deprecated use id_aa_ets_otherSigCert instead */ + @Deprecated ASN1ObjectIdentifier id_aa_otherSigCert = id_aa_ets_otherSigCert; /** @@ -431,6 +437,7 @@ public interface PKCSObjectIdentifiers * 1.2.840.113549.1.9.16.5 * @deprecated use id_spq_oid instead */ + @Deprecated final String id_spq = "1.2.840.113549.1.9.16.5"; ASN1ObjectIdentifier id_spq_oid = id_smime.branch("5"); @@ -481,6 +488,7 @@ public interface PKCSObjectIdentifiers * PKCS#12: 1.2.840.113549.1.12.1.6 * @deprecated use pbeWithSHAAnd40BitRC2_CBC */ + @Deprecated ASN1ObjectIdentifier pbewithSHAAnd40BitRC2_CBC = pkcs_12PbeIds.branch("6"); } diff --git a/core/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java b/core/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java index 2e8dad1a60..a8b51780a9 100644 --- a/core/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java @@ -74,6 +74,7 @@ public SubjectPublicKeyInfo( /** @deprecated use SubjectPublicKeyInfo.getInstance() */ + @Deprecated public SubjectPublicKeyInfo( ASN1Sequence seq) { @@ -98,6 +99,7 @@ public AlgorithmIdentifier getAlgorithm() * @deprecated use getAlgorithm() * @return alg ID. */ + @Deprecated public AlgorithmIdentifier getAlgorithmId() { return algId; @@ -126,6 +128,7 @@ public ASN1Primitive parsePublicKey() * @deprecated use parsePublicKey * @return the public key as an ASN.1 primitive. */ + @Deprecated public ASN1Primitive getPublicKey() throws IOException { diff --git a/core/src/main/java/org/bouncycastle/crypto/AsymmetricCipherKeyPair.java b/core/src/main/java/org/bouncycastle/crypto/AsymmetricCipherKeyPair.java index ddee701914..b129ed57db 100644 --- a/core/src/main/java/org/bouncycastle/crypto/AsymmetricCipherKeyPair.java +++ b/core/src/main/java/org/bouncycastle/crypto/AsymmetricCipherKeyPair.java @@ -31,6 +31,7 @@ public AsymmetricCipherKeyPair( * @param privateParam the corresponding private key parameters. * @deprecated use AsymmetricKeyParameter */ + @Deprecated public AsymmetricCipherKeyPair( CipherParameters publicParam, CipherParameters privateParam) diff --git a/core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java b/core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java index ac2eb9aa6a..9e200318f4 100644 --- a/core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java +++ b/core/src/main/java/org/bouncycastle/crypto/engines/AESEngine.java @@ -435,6 +435,7 @@ public static MultiBlockCipher newInstance() * default constructor - 128 bit block size. * @deprecated use AESEngine.newInstance() */ + @Deprecated public AESEngine() { CryptoServicesRegistrar.checkConstraints(new DefaultServiceProperties(getAlgorithmName(), 256)); diff --git a/core/src/main/java/org/bouncycastle/crypto/engines/RSABlindedEngine.java b/core/src/main/java/org/bouncycastle/crypto/engines/RSABlindedEngine.java index 4ce1fccedd..36103654a1 100644 --- a/core/src/main/java/org/bouncycastle/crypto/engines/RSABlindedEngine.java +++ b/core/src/main/java/org/bouncycastle/crypto/engines/RSABlindedEngine.java @@ -28,7 +28,7 @@ public class RSABlindedEngine * initialise the RSA engine. * * @param forEncryption true if we are encrypting, false otherwise. - * @param param the necessary RSA key parameters. + * @param parameters the necessary RSA key parameters. */ public void init(boolean forEncryption, CipherParameters parameters) { diff --git a/core/src/main/java/org/bouncycastle/crypto/modes/SICBlockCipher.java b/core/src/main/java/org/bouncycastle/crypto/modes/SICBlockCipher.java index 95f386b9a5..f9a606a2b3 100644 --- a/core/src/main/java/org/bouncycastle/crypto/modes/SICBlockCipher.java +++ b/core/src/main/java/org/bouncycastle/crypto/modes/SICBlockCipher.java @@ -41,6 +41,7 @@ public static CTRModeCipher newInstance(BlockCipher cipher) * @param c the block cipher to be used. * @deprecated use newInstance() method. */ + @Deprecated public SICBlockCipher(BlockCipher c) { super(c); diff --git a/core/src/main/java/org/bouncycastle/crypto/params/SAKKEPublicKeyParameters.java b/core/src/main/java/org/bouncycastle/crypto/params/SAKKEPublicKeyParameters.java index 5dc57b95d1..1796346dd1 100644 --- a/core/src/main/java/org/bouncycastle/crypto/params/SAKKEPublicKeyParameters.java +++ b/core/src/main/java/org/bouncycastle/crypto/params/SAKKEPublicKeyParameters.java @@ -191,7 +191,7 @@ public Digest getDigest() } /** - * @return The pairing result g =
(RFC 6508, Section 3.2) + * @return The pairing result {@code g =
} (RFC 6508, Section 3.2)
*/
public BigInteger getG()
{
diff --git a/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java b/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
index de75cb24ff..378cf46277 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
@@ -691,6 +691,7 @@ public static class Fp extends AbstractFp
/**
* @deprecated use constructor taking order/cofactor
*/
+ @Deprecated
public Fp(BigInteger q, BigInteger a, BigInteger b)
{
this(q, a, b, null, null);
@@ -1153,6 +1154,7 @@ public static class F2m extends AbstractF2m
* F2m
.
* @deprecated use constructor taking order/cofactor
*/
+ @Deprecated
public F2m(
int m,
int k,
@@ -1211,6 +1213,7 @@ public F2m(
* F2m
.
* @deprecated use constructor taking order/cofactor
*/
+ @Deprecated
public F2m(
int m,
int k1,
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/CMCEPublicKey.java b/core/src/main/java/org/bouncycastle/pqc/asn1/CMCEPublicKey.java
index e09a5d17da..1600da6e34 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/CMCEPublicKey.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/CMCEPublicKey.java
@@ -34,6 +34,7 @@ public CMCEPublicKey(byte[] t)
/**
* @deprecated use getInstance()
*/
+ @Deprecated
public CMCEPublicKey(ASN1Sequence seq)
{
T = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/FalconPublicKey.java b/core/src/main/java/org/bouncycastle/pqc/asn1/FalconPublicKey.java
index d5dc89dccb..1e7a84a09b 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/FalconPublicKey.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/FalconPublicKey.java
@@ -32,6 +32,7 @@ public byte[] getH()
/**
* @deprecated use getInstance()
*/
+ @Deprecated
public FalconPublicKey(ASN1Sequence seq)
{
h = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/KyberPublicKey.java b/core/src/main/java/org/bouncycastle/pqc/asn1/KyberPublicKey.java
index a498e7857b..e020605f63 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/KyberPublicKey.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/KyberPublicKey.java
@@ -36,6 +36,7 @@ public KyberPublicKey(byte[] t, byte[] rho)
/**
* @deprecated use getInstance()
*/
+ @Deprecated
public KyberPublicKey(ASN1Sequence seq)
{
t = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/PQCObjectIdentifiers.java b/core/src/main/java/org/bouncycastle/pqc/asn1/PQCObjectIdentifiers.java
index e88bb0898d..cb05d3b804 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/PQCObjectIdentifiers.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/PQCObjectIdentifiers.java
@@ -86,35 +86,43 @@ public interface PQCObjectIdentifiers
/**
* @deprecated use xmss_SHA256ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_with_SHA256 = xmss_SHA256ph;
/**
* @deprecated use xmss_SHA512ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_with_SHA512 = xmss_SHA512ph;
/**
* @deprecated use xmss_SHAKE128ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_with_SHAKE128 = xmss_SHAKE128ph;
/**
* @deprecated use xmss_SHAKE256ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_with_SHAKE256 = xmss_SHAKE256ph;
/**
* @deprecated use xmss_mt_SHA256ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHA256 = xmss_mt_SHA256ph;
/**
* @deprecated use xmss_mt_SHA512ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHA512 = xmss_mt_SHA512ph;
/**
* @deprecated use xmss_mt_SHAKE128ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHAKE128 = xmss_mt_SHAKE128ph;
/**
* @deprecated use xmss_mt_SHAKE256ph
*/
+ @Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHAKE256 = xmss_mt_SHAKE256ph;
/**
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPrivateKey.java b/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPrivateKey.java
index 3f86bbe1c3..1de44f891b 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPrivateKey.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPrivateKey.java
@@ -68,6 +68,7 @@ public SPHINCSPLUSPrivateKey(int version, byte[] skseed, byte[] skprf, SPHINCSPL
/**
* @deprecated use getInstance()
*/
+ @Deprecated
public SPHINCSPLUSPrivateKey(ASN1Sequence seq)
{
version = ASN1Integer.getInstance(seq.getObjectAt(0)).intValueExact();
diff --git a/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPublicKey.java b/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPublicKey.java
index d0514d6ffc..0ff3410bb4 100644
--- a/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPublicKey.java
+++ b/core/src/main/java/org/bouncycastle/pqc/asn1/SPHINCSPLUSPublicKey.java
@@ -29,6 +29,7 @@ public SPHINCSPLUSPublicKey(byte[] pkseed, byte[] pkroot)
/**
* @deprecated use getInstance()
*/
+ @Deprecated
public SPHINCSPLUSPublicKey(ASN1Sequence seq)
{
pkseed = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumParameters.java
index b64cc82ab5..97843ecac0 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumParameters.java
@@ -15,6 +15,7 @@ public class DilithiumParameters
* @deprecated
* obsolete to be removed
*/
+ @Deprecated
private final boolean usingAES;// or shake
private DilithiumParameters(String name, int k, boolean usingAES)
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumPrivateKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumPrivateKeyParameters.java
index 4193d654b8..8ecc27ced8 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumPrivateKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/crystals/dilithium/DilithiumPrivateKeyParameters.java
@@ -63,6 +63,7 @@ public byte[] getK()
}
/** @deprecated Use {@link #getEncoded()} instead. */
+ @Deprecated
public byte[] getPrivateKey()
{
return getEncoded();
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/mldsa/MLDSAPrivateKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/mldsa/MLDSAPrivateKeyParameters.java
index 03f56b6abd..be2449a59e 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/mldsa/MLDSAPrivateKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/mldsa/MLDSAPrivateKeyParameters.java
@@ -138,6 +138,7 @@ public byte[] getK()
/**
* @deprecated Use {@link #getEncoded()} instead.
*/
+ @Deprecated
public byte[] getPrivateKey()
{
return getEncoded();
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus/SPHINCSPlusParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus/SPHINCSPlusParameters.java
index 35204ee8f1..c7cd880575 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus/SPHINCSPlusParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/sphincsplus/SPHINCSPlusParameters.java
@@ -193,6 +193,7 @@ public static SPHINCSPlusParameters getParams(Integer id)
* @return the OID for the parameter set.
* @deprecated Use {@link #getID()} instead
*/
+ @Deprecated
public static Integer getID(SPHINCSPlusParameters params)
{
return params.getID();
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
index 3cdee493ab..9dcde26aa1 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPrivateKeyParameters.java
@@ -262,6 +262,7 @@ public XMSSMTPrivateKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
+ @Deprecated
public byte[] toByteArray()
{
synchronized (this)
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPublicKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPublicKeyParameters.java
index 9b1e3d2e5d..bb43419e09 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPublicKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSMTPublicKeyParameters.java
@@ -144,6 +144,7 @@ public XMSSMTPublicKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
+ @Deprecated
public byte[] toByteArray()
{
/* oid || root || seed */
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPrivateKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPrivateKeyParameters.java
index beea21ef47..ad8ba6d195 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPrivateKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPrivateKeyParameters.java
@@ -350,6 +350,7 @@ public XMSSPrivateKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
+ @Deprecated
public byte[] toByteArray()
{
synchronized (this)
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPublicKeyParameters.java b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPublicKeyParameters.java
index be24df58d9..cb89612fd5 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPublicKeyParameters.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSPublicKeyParameters.java
@@ -149,6 +149,7 @@ public XMSSPublicKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
+ @Deprecated
public byte[] toByteArray()
{
/* oid || root || seed */
diff --git a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSStoreableObjectInterface.java b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSStoreableObjectInterface.java
index 1df76eca4a..f7c5fee430 100644
--- a/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSStoreableObjectInterface.java
+++ b/core/src/main/java/org/bouncycastle/pqc/crypto/xmss/XMSSStoreableObjectInterface.java
@@ -5,6 +5,7 @@
*
* @deprecated use Encodable
*/
+@Deprecated
public interface XMSSStoreableObjectInterface
{
@@ -13,5 +14,5 @@ public interface XMSSStoreableObjectInterface
*
* @return Byte representation of object.
*/
- public byte[] toByteArray();
+ byte[] toByteArray();
}
diff --git a/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/ByteUtils.java b/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/ByteUtils.java
index 26eeaa69fd..60dc77e1af 100644
--- a/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/ByteUtils.java
+++ b/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/ByteUtils.java
@@ -7,6 +7,7 @@
*
* @deprecated use org.bouncycastle.util.Arrays.
*/
+@Deprecated
public final class ByteUtils
{
diff --git a/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/IntegerFunctions.java b/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/IntegerFunctions.java
index 8e44d10523..c2d032dd87 100644
--- a/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/IntegerFunctions.java
+++ b/core/src/main/java/org/bouncycastle/pqc/legacy/math/linearalgebra/IntegerFunctions.java
@@ -1061,6 +1061,7 @@ public static float floatPow(float f, int i)
* @return log_2(x)
* @deprecated use MathFunctions.log(double) instead
*/
+ @Deprecated
public static double log(double x)
{
if (x > 0 && x < 1)
@@ -1092,6 +1093,7 @@ public static double log(double x)
* @return log_2(x)
* @deprecated use MathFunctions.log(long) instead
*/
+ @Deprecated
public static double log(long x)
{
int tmp = floorLog(BigInteger.valueOf(x));
@@ -1108,9 +1110,10 @@ public static double log(long x)
* @return log_2(arg)
* @deprecated use MathFunctions.logBKM(double) instead
*/
+ @Deprecated
private static double logBKM(double arg)
{
- double ae[] = // A_e[k] = log_2 (1 + 0.5^k)
+ double[] ae = // A_e[k] = log_2 (1 + 0.5^k)
{
1.0000000000000000000000000000000000000000000000000000000000000000000000000000,
0.5849625007211561814537389439478165087598144076924810604557526545410982276485,
diff --git a/core/src/main/java/org/bouncycastle/util/Fingerprint.java b/core/src/main/java/org/bouncycastle/util/Fingerprint.java
index 7027d4948c..aff0427f65 100644
--- a/core/src/main/java/org/bouncycastle/util/Fingerprint.java
+++ b/core/src/main/java/org/bouncycastle/util/Fingerprint.java
@@ -45,6 +45,7 @@ public Fingerprint(byte[] source, int bitLength)
* @param useSHA512t use the old SHA512/160 calculation.
* @deprecated use the SHAKE only version.
*/
+ @Deprecated
public Fingerprint(byte[] source, boolean useSHA512t)
{
if (useSHA512t)
@@ -143,6 +144,7 @@ public static byte[] calculateFingerprint(byte[] input, int bitLength)
* @return a byte array containing a 20 byte fingerprint.
* @deprecated use the SHAKE based version.
*/
+ @Deprecated
public static byte[] calculateFingerprintSHA512_160(byte[] input)
{
SHA512tDigest digest = new SHA512tDigest(160);
diff --git a/core/src/main/java/org/bouncycastle/util/Pack.java b/core/src/main/java/org/bouncycastle/util/Pack.java
index d3a360975f..79d7ec9dba 100644
--- a/core/src/main/java/org/bouncycastle/util/Pack.java
+++ b/core/src/main/java/org/bouncycastle/util/Pack.java
@@ -159,6 +159,7 @@ public static void longToBigEndian(long[] ns, int nsOff, int nsLen, byte[] bs, i
* @param bytes number of bytes to write.
* @deprecated Will be removed
*/
+ @Deprecated
public static void longToBigEndian(long value, byte[] bs, int off, int bytes)
{
for (int i = bytes - 1; i >= 0; i--)
diff --git a/mail/src/main/java/org/bouncycastle/mail/smime/validator/SignedMailValidator.java b/mail/src/main/java/org/bouncycastle/mail/smime/validator/SignedMailValidator.java
index a6c99488de..b3c82ae128 100644
--- a/mail/src/main/java/org/bouncycastle/mail/smime/validator/SignedMailValidator.java
+++ b/mail/src/main/java/org/bouncycastle/mail/smime/validator/SignedMailValidator.java
@@ -360,12 +360,7 @@ protected void validateSignatures(PKIXParameters pkixParam)
{
review = (PKIXCertPathReviewer)certPathReviewerClass.newInstance();
}
- catch (IllegalAccessException e)
- {
- throw new IllegalArgumentException("Cannot instantiate object of type " +
- certPathReviewerClass.getName() + ": " + e.getMessage());
- }
- catch (InstantiationException e)
+ catch (IllegalAccessException | InstantiationException e)
{
throw new IllegalArgumentException("Cannot instantiate object of type " +
certPathReviewerClass.getName() + ": " + e.getMessage());
@@ -418,15 +413,15 @@ public static Set getEmailAddresses(X509Certificate cert)
TBSCertificate tbsCertificate = getTBSCert(cert);
RDN[] rdns = tbsCertificate.getSubject().getRDNs(PKCSObjectIdentifiers.pkcs_9_at_emailAddress);
- for (int i = 0; i < rdns.length; i++)
+ for (RDN rdn : rdns)
{
- AttributeTypeAndValue[] atVs = rdns[i].getTypesAndValues();
+ AttributeTypeAndValue[] atVs = rdn.getTypesAndValues();
for (int j = 0; j != atVs.length; j++)
{
if (atVs[j].getType().equals(PKCSObjectIdentifiers.pkcs_9_at_emailAddress))
{
- String email = ((ASN1String)atVs[j].getValue()).getString().toLowerCase();
+ String email = ((ASN1String) atVs[j].getValue()).getString().toLowerCase();
addresses.add(email);
}
}
@@ -456,10 +451,12 @@ public static Set getEmailAddresses(X509Certificate cert)
private static ASN1Primitive getObject(byte[] ext)
throws IOException
{
- ASN1InputStream aIn = new ASN1InputStream(ext);
- ASN1OctetString octs = ASN1OctetString.getInstance(aIn.readObject());
+ try (ASN1InputStream aIn = new ASN1InputStream(ext))
+ {
+ ASN1OctetString octs = ASN1OctetString.getInstance(aIn.readObject());
- return ASN1Primitive.fromByteArray(octs.getOctets());
+ return ASN1Primitive.fromByteArray(octs.getOctets());
+ }
}
protected void checkSignerCert(X509Certificate cert, List errors,
@@ -547,9 +544,9 @@ else if (key instanceof DSAPublicKey)
// check if email in cert is equal to the from address in the
// message
boolean equalsFrom = false;
- for (int i = 0; i < fromAddresses.length; i++)
+ for (String fromAddress : fromAddresses)
{
- if (certEmails.contains(fromAddresses[i].toLowerCase()))
+ if (certEmails.contains(fromAddress.toLowerCase()))
{
equalsFrom = true;
break;
@@ -621,16 +618,15 @@ private static List findCerts(List certStores, X509CertSelector selector)
throws CertStoreException
{
List result = new ArrayList();
- Iterator it = certStores.iterator();
- while (it.hasNext())
+ for (Object certStore : certStores)
{
- CertStore store = (CertStore)it.next();
+ CertStore store = (CertStore) certStore;
Collection coll = store.getCertificates(selector);
// sometimes the subjectKeyIdentifier in a TA certificate, even when the authorityKeyIdentifier is set.
// where this happens we role back to a simpler match to make sure we've got all the possibilities.
if (coll.isEmpty() && selector.getSubjectKeyIdentifier() != null)
{
- X509CertSelector certSelector = (X509CertSelector)selector.clone();
+ X509CertSelector certSelector = (X509CertSelector) selector.clone();
certSelector.setSubjectKeyIdentifier(null);
coll = store.getCertificates(certSelector);
}
diff --git a/mls/src/main/java/org/bouncycastle/mls/client/MLSClientImpl.java b/mls/src/main/java/org/bouncycastle/mls/client/MLSClientImpl.java
index 201e34a78d..541aedffb9 100644
--- a/mls/src/main/java/org/bouncycastle/mls/client/MLSClientImpl.java
+++ b/mls/src/main/java/org/bouncycastle/mls/client/MLSClientImpl.java
@@ -47,7 +47,7 @@
public class MLSClientImpl
extends MLSClientGrpc.MLSClientImplBase
{
- class CachedGroup
+ static class CachedGroup
{
Group group;
boolean encryptHandshake;
@@ -70,7 +70,7 @@ public void resetPending()
}
}
- class CachedJoin
+ static class CachedJoin
{
KeyPackageWithSecrets kpSecrets;
Mapresource
or id
is null
*/
- public LocalizedMessage(String resource,String id) throws NullPointerException
+ public LocalizedMessage(String resource, String id) throws NullPointerException
{
if (resource == null || id == null)
{
@@ -59,7 +59,7 @@ public LocalizedMessage(String resource,String id) throws NullPointerException
* @throws NullPointerException if resource
or id
is null
* @throws UnsupportedEncodingException if the encoding is not supported
*/
- public LocalizedMessage(String resource,String id, String encoding) throws NullPointerException, UnsupportedEncodingException
+ public LocalizedMessage(String resource, String id, String encoding) throws NullPointerException, UnsupportedEncodingException
{
if (resource == null || id == null)
{
@@ -126,10 +126,10 @@ public LocalizedMessage(String resource, String id, String encoding, Object[] ar
* @param key second part of the entry id
* @param loc the used {@link Locale}
* @param timezone the used {@link TimeZone}
- * @return a Strng containing the localized message
+ * @return a String containing the localized message
* @throws MissingEntryException if the resource file is not available or the entry does not exist.
*/
- public String getEntry(String key,Locale loc, TimeZone timezone) throws MissingEntryException
+ public String getEntry(String key, Locale loc, TimeZone timezone) throws MissingEntryException
{
String entry = id;
if (key != null)
diff --git a/test/src/main/java/org/bouncycastle/test/est/ESTServerUtils.java b/test/src/main/java/org/bouncycastle/test/est/ESTServerUtils.java
index c48e0a3b8e..dea7abc90a 100644
--- a/test/src/main/java/org/bouncycastle/test/est/ESTServerUtils.java
+++ b/test/src/main/java/org/bouncycastle/test/est/ESTServerUtils.java
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.IOException;
+import java.net.InetAddress;
import java.net.Socket;
import java.util.Arrays;
import java.util.List;
@@ -94,7 +95,7 @@ public static void waitForSocket(int port)
try
{
Thread.sleep(100);
- sock = new Socket("127.0.0.1", port);
+ sock = new Socket(InetAddress.getLoopbackAddress(), port);
break;
}
catch (Exception ex)
diff --git a/tls/src/main/java/org/bouncycastle/jsse/provider/NamedGroupInfo.java b/tls/src/main/java/org/bouncycastle/jsse/provider/NamedGroupInfo.java
index f2af7facd9..f398b8ca0c 100644
--- a/tls/src/main/java/org/bouncycastle/jsse/provider/NamedGroupInfo.java
+++ b/tls/src/main/java/org/bouncycastle/jsse/provider/NamedGroupInfo.java
@@ -19,7 +19,6 @@
import org.bouncycastle.tls.TlsUtils;
import org.bouncycastle.tls.crypto.impl.jcajce.JcaTlsCrypto;
import org.bouncycastle.util.Arrays;
-import org.bouncycastle.util.Integers;
import org.bouncycastle.util.Properties;
class NamedGroupInfo
@@ -138,7 +137,7 @@ static class PerConnection
this.local = local;
this.localECDSA = localECDSA;
- this.peer = new AtomicReference>();
+ this.peer = new AtomicReference<>();
}
List