Skip to content

Commit

Permalink
fix: adjust to new classes for bouncycastle 2.+
Browse files Browse the repository at this point in the history
Update as required for 2.+ bouncycastle libraries.

[#TPCF-6875]
[#TPCF-6876]
  • Loading branch information
Tallicia committed Aug 20, 2024
1 parent 6e5740e commit 432e0ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
apacheCommonsIoVersion = '2.16.1'
apacheHttpClientVersion = '4.5.14'
asciiDoctorConvertPluginVersion = '4.0.3'
bcpkixFipsVersion = '1.0.7'
bcFipsVersion = '1.0.2.5'
bcpkixFipsVersion = '2.0.7'
bcFipsVersion = '2.0.0'
commonsCodecVersion = '1.17.1' // remove this after deleting (now deprecated) spring-security-oauth2
flywayVersion = '7.15.0'
guavaVersion = '33.2.1-jre'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.cloudfoundry.credhub.utils

import org.bouncycastle.asn1.pkcs.PrivateKeyInfo
import org.bouncycastle.openssl.PEMException
import org.bouncycastle.openssl.PEMKeyPair
import org.bouncycastle.openssl.PEMParser
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
import org.bouncycastle.util.encoders.DecoderException
import org.cloudfoundry.credhub.exceptions.MalformedPrivateKeyException
import java.io.StringReader
import java.security.KeyFactory
Expand All @@ -24,7 +24,7 @@ class PrivateKeyReader private constructor() {
pemParser = PEMParser(StringReader(privateKeyPem!!))
parsed = pemParser.readObject()
pemParser.close()
} catch (e: PEMException) {
} catch (e: DecoderException) {
throw MalformedPrivateKeyException("Keys must be PEM-encoded PKCS#1 or unencrypted PKCS#8 keys.")
}

Expand Down

0 comments on commit 432e0ea

Please sign in to comment.