You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/07/20 10:56:25 UTC
[2/2] cxf-fediz git commit: Fixing NPE if no key alias
Fixing NPE if no key alias
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/1a26bcf4
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/1a26bcf4
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/1a26bcf4
Branch: refs/heads/master
Commit: 1a26bcf4f0b34f10c23d0ca46b9bec72a4a956df
Parents: d280bce
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Jul 20 11:56:13 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Jul 20 11:56:13 2016 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/1a26bcf4/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
index a1e2848..24d6be1 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java
@@ -110,6 +110,10 @@ public final class CertsUtils {
keyAlias = crypto.getDefaultX509Identifier();
}
+ if (keyAlias == null) {
+ throw new RuntimeException("No keystore alias was specified to sign the metadata");
+ }
+
CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS);
cryptoType.setAlias(keyAlias);
X509Certificate[] issuerCerts = crypto.getX509Certificates(cryptoType);