Skip to content

Commit

Permalink
Changes after feedback from Jovche
Browse files Browse the repository at this point in the history
  • Loading branch information
keesgeluk committed Oct 30, 2023
1 parent 0546c20 commit 147fadd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder
import org.bouncycastle.operator.OperatorCreationException
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder
import java.io.IOException
import java.security.NoSuchAlgorithmException
import java.security.cert.CertificateException
import java.security.cert.X509Certificate
import java.util.Optional
Expand Down Expand Up @@ -49,12 +48,7 @@ object CertificateGenerator {


// Extensions --------------------------
val jcaX509ExtensionUtils: JcaX509ExtensionUtils
jcaX509ExtensionUtils = try {
JcaX509ExtensionUtils()
} catch (e: NoSuchAlgorithmException) {
throw RuntimeException(e)
}
val jcaX509ExtensionUtils = JcaX509ExtensionUtils()
if (issuerCert.isPresent) {
try {
// adds 3 more fields, not present in other cert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ object ReaderCertificateGenerator {
return try {
// NOTE older devices may not have the right BC installed for this to work
val kpg: KeyPairGenerator
if (curve.equals("Ed25519", ignoreCase = true) || curve.equals(
"Ed448",
ignoreCase = true
)
) {
if (listOf("Ed25519", "Ed448").any { it.equals(curve, ignoreCase = true) }) {
kpg = KeyPairGenerator.getInstance(curve, BouncyCastleProvider())
} else {
kpg = KeyPairGenerator.getInstance("EC", BouncyCastleProvider())
Expand All @@ -46,7 +42,6 @@ object ReaderCertificateGenerator {
}
}

@Throws(Exception::class)
fun createReaderCertificate(
dsKeyPair: KeyPair, issuerCert: X509Certificate,
issuerPrivateKey: PrivateKey
Expand Down

0 comments on commit 147fadd

Please sign in to comment.