Skip to content

Commit

Permalink
- PKCS11 Certificate access adjustment on JVMs that don't support a d…
Browse files Browse the repository at this point in the history
…iscovered algorithm
  • Loading branch information
lhazlewood committed Aug 30, 2023
1 parent 3f1580b commit 3ab2518
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,17 @@ class TestCertificates {

for (Identifiable alg : algs) {
def priv = null
def cert = null
def pub
def cert
try {
priv = ks.getKey(alg.id, pin) as PrivateKey
//println "key: $key"
} catch (Throwable ignored) { // cannot load on current JVM (algorithm not available)
}

cert = ks.getCertificate(alg.id) as X509Certificate
try {
cert = ks.getCertificate(alg.id) as X509Certificate
} catch (Throwable ignored) { // cannot load on current JVM (algorithm not available)
}
if (cert != null) { // will be null for PS* algs since SoftHSM2 doesn't support them yet
pub = cert.getPublicKey()
def bundle = new TestKeys.Bundle(alg, pub, priv, cert)
Expand Down

0 comments on commit 3ab2518

Please sign in to comment.