[xmlsectool] branch master updated: XSTJ-76 - correct error message when key entry missing from keystore

Ian Young ian at iay.org.uk
Tue May 15 07:33:18 EDT 2018


This is an automated email from the git hooks/post-receive script.

iay pushed a commit to branch master
in repository xmlsectool.

View the commit online:
http://git.shibboleth.net/view/?p=xmlsectool.git;a=commit;h=a93b325d9f82bd1a49e17e2e5f8afe4688c11946

The following commit(s) were added to refs/heads/master by this push:
       new  a93b325   XSTJ-76 - correct error message when key entry missing from keystore
a93b325 is described below

commit a93b325d9f82bd1a49e17e2e5f8afe4688c11946
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Tue May 15 12:33:11 2018 +0100

    XSTJ-76 - correct error message when key entry missing from keystore
---
 src/main/java/net/shibboleth/tool/xmlsectool/CredentialHelper.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/net/shibboleth/tool/xmlsectool/CredentialHelper.java b/src/main/java/net/shibboleth/tool/xmlsectool/CredentialHelper.java
index 242b007..5ba45d0 100644
--- a/src/main/java/net/shibboleth/tool/xmlsectool/CredentialHelper.java
+++ b/src/main/java/net/shibboleth/tool/xmlsectool/CredentialHelper.java
@@ -26,6 +26,7 @@ import java.security.KeyException;
 import java.security.KeyStore;
 import java.security.KeyStore.PrivateKeyEntry;
 import java.security.KeyStore.TrustedCertificateEntry;
+import java.security.KeyStoreException;
 import java.security.Provider;
 import java.security.Security;
 import java.security.cert.CertificateException;
@@ -196,6 +197,9 @@ public final class CredentialHelper {
 
         final KeyStore.Entry keyEntry = keystore.getEntry(keyAlias,
                 new KeyStore.PasswordProtection(keyPassword.toCharArray()));
+        if (keyEntry == null) {
+            throw new KeyStoreException("entry '" + keyAlias + "' not found in keystore");
+        }
 
         final BasicX509Credential credential;
         if (keyEntry instanceof PrivateKeyEntry) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list