You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 90d1f8a
Browse filesBrowse the repository at this point in the historyBrowse files
Add org.bouncycastle.pkcs12.store_it_count so the PBE iteration count the PKCS12 keystore writes with is settable, the write-side counterpart of the existing max_it_count that only bounds what is accepted on load, and bring the jdk1.3 and jdk1.4 keystore overlays into step with it so all three distributions share the 600,000 default rather than the 1,024 and 51,200 they had kept, take their MAC count from a file they loaded, and honour the property, with the Gradle and Ant test harnesses setting it low so the suites do not spend their time on the KDF.
Copy file name to clipboardExpand all lines: docs/releasenotes.html
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -143,9 +143,10 @@ <h3>2.1.2 Defects Fixed</h3>
143
143
144
144
<h3>2.1.3 Additional Features and Functionality</h3>
145
145
<ul>
146
+
<li>The new org.bouncycastle.pkcs12.store_it_count property sets the PBE iteration count the PKCS12 keystore uses when writing a file, the write-side counterpart of the existing org.bouncycastle.pkcs12.max_it_count, which only bounds what is accepted on load. The default is unchanged - 600,000 for the key and certificate encryption, twice that for the integrity MAC - but until now there was no way to ask for anything else, and the count was raised from 51,200 in 1.85, which multiplies the cost of writing or reading a keystore by about twelve. Lowering it trades password-cracking resistance for store and load time, and is only worth doing where something other than the passphrase carries the confidentiality of the file: a machine-generated high-entropy password, or a keystore held somewhere already protected. It is deliberately an operator setting rather than a per-call one, so a deployment that wants cheaper files sets it once at startup. A value outside 1 .. 2,500,000 is ignored and the default used, the upper bound keeping the doubled MAC count inside the 5,000,000 that org.bouncycastle.pkcs12.max_it_count defaults to, so a file written under this property can always be read back. A keystore loaded from an existing file still keeps and rewrites the MAC iteration count it arrived with. The same change corrects a long standing divergence in the legacy Ant distributions, whose hand maintained copies of the keystore SPIs had never been brought forward: the jdk13 and jdk14 jars were writing PKCS12 files at 1,024 iterations - the figure PKCS#12 shipped with in the 1990s - and their PBMAC1 keystore at 51,200, rather than the count the modern jars use, and neither took its MAC count from a file it had loaded. All three now share the default and honour the new property.</li>
146
147
<li>OpenPGP secret keys whose private key material is held outside the key - on a hardware token - are now supported, following <a href="https://datatracker.ietf.org/doc/draft-dkg-openpgp-external-secrets/">draft-dkg-openpgp-external-secrets</a>. org.bouncycastle.bcpg.SecretKeyPacket recognises the External S2K usage octet (SecretKeyPacket.USAGE_EXTERNAL) and its locator hint, PGPSecretKey exposes isExternalKey() / getExternalKeyLocatorHint(), and a decryption backend is plugged into the high level API by registering an org.bouncycastle.openpgp.api.PublicKeyDataDecryptorFactoryProvider with OpenPGPMessageProcessor. On the lightweight side BcPublicKeyDataDecryptorFactory now isolates the raw private-key operation behind BcPublicKeyCryptoCallback, so a subclass of the new org.bouncycastle.openpgp.api.operator.bc.BcExternalPublicKeyDataDecryptorFactory routes only the RSA decryption or the ECDH/X25519 agreement to a device while inheriting all packet parsing, KDF and key-unwrap logic. org.bouncycastle.openpgp.api.operator.jcajce.JceExternalPublicKeyDataDecryptorFactoryBuilder is the JCA/JCE analogue: its factories inherit the session-key recovery flow from the new stack-neutral org.bouncycastle.openpgp.api.operator.AbstractExternalPublicKeyDataDecryptorFactory (which carries the parsing, length checks and KDF/key-unwrap sequencing over byte-level primitive hooks), bind the HKDF, key unwrap and ephemeral-key handling to the configured JCA provider, and present the sender's ephemeral key to the device callback as a java.security.PublicKey. Note the External S2K usage octet is provisional: the draft records it as "TBD (252?)" and IANA has not assigned it.</li>
147
-
<li>A new module, bcpgsc (org.bouncycastle.openpgp.smartcard), provides an OpenPGP smart-card API on top of the external-secret-key support: listing cards across pluggable backends, uploading key material, and decrypting messages with a card-held key. Two backends ship - a YubiKey backend built on the YubiKit libraries, and an in-memory simulator for testing without hardware. The YubiKit libraries are a compile-only dependency, so the published bcpgsc jar carries no third-party runtime dependency; an application using org.bouncycastle.openpgp.smartcard.yubikey must add them to its own classpath. The YubiKey backend can route decryption through either the lightweight or the JCA/JCE operator binding, selected with YubikeySmartCardBackend.bcImpl() / jceImpl(). Contributed by Paul Schaub.</li>
148
-
<li>org.bouncycastle.openpgp.operator.PGPKeyPairGenerator gained named convenience methods for the three brainpool curves RFC 9580 sec. 9.2 permits for OpenPGP - generateBrainpoolP256r1ECDHKeyPair / generateBrainpoolP384r1ECDHKeyPair / generateBrainpoolP512r1ECDHKeyPair and the matching ECDSA variants - alongside the existing NIST P-256/P-384/P-521 methods. The generated ECDH keys carry the per-curve KDF hash and KEK symmetric algorithm required by sec. 11.5.1, which the key-pair generator tests now assert for the brainpool and the NIST curves alike. Contributed by Paul Schaub.</li>
148
+
<li>A new module, bcpgsc (org.bouncycastle.openpgp.smartcard), provides an OpenPGP smart-card API on top of the external-secret-key support: listing cards across pluggable backends, uploading key material, and decrypting messages with a card-held key. Two backends ship - a YubiKey backend built on the YubiKit libraries, and an in-memory simulator for testing without hardware. The YubiKit libraries are a compile-only dependency, so the published bcpgsc jar carries no third-party runtime dependency; an application using org.bouncycastle.openpgp.smartcard.yubikey must add them to its own classpath. The YubiKey backend can route decryption through either the lightweight or the JCA/JCE operator binding, selected with YubikeySmartCardBackend.bcImpl() / jceImpl().</li>
149
+
<li>org.bouncycastle.openpgp.operator.PGPKeyPairGenerator gained named convenience methods for the three brainpool curves RFC 9580 sec. 9.2 permits for OpenPGP - generateBrainpoolP256r1ECDHKeyPair / generateBrainpoolP384r1ECDHKeyPair / generateBrainpoolP512r1ECDHKeyPair and the matching ECDSA variants - alongside the existing NIST P-256/P-384/P-521 methods. The generated ECDH keys carry the per-curve KDF hash and KEK symmetric algorithm required by sec. 11.5.1, which the key-pair generator tests now assert for the brainpool and the NIST curves alike.</li>
149
150
<li>Further extended key usages are now available as KeyPurposeId constants: id-kp-secureShellClient and id-kp-secureShellServer (RFC 6187 sec. 2.2.2, id-kp 21/22), id-kp-cmcArchive (RFC 6402 sec. 2.10, id-kp 29) and id-kp-bundleSecurity (RFC 9174, id-kp 35).</li>
150
151
<li>The two RFC 4556 (PKINIT) extended key usages are now available as KeyPurposeId constants: id-pkinit-KPClientAuth (1.3.6.1.5.2.3.4, sec. 3.2.2) as KeyPurposeId.id_kp_pkinitClientAuth and id-pkinit-KPKdc (1.3.6.1.5.2.3.5, sec. 3.2.4) as KeyPurposeId.id_kp_pkinitKdc. Note these sit under the Kerberos id-pkinit arc rather than the PKIX id-kp arc, and are distinct from the Microsoft smartcard logon usage already available as id_kp_smartcardlogon.</li>
151
152
<li>org.bouncycastle.math.ec.ECConstantTimeMultiplier is a new constant-time variable-point scalar multiplier: a fixed window with signed-odd-digit recoding, so the iteration and doubling counts are independent of the scalar, with table entries fetched through ECCurve.createCacheSafeLookupTable's masked scan. It works over both prime and binary curves (the point must lie in the subgroup of the given, odd, group order) and returns exactly the point the existing multipliers do - only the timing profile differs. Use it via the new ECAlgorithms.multiplySecret(p, k) / multiplySecret(p, k, order), or install it on a curve with ECCurve.Config.setMultiplier.</li>
0 commit comments