commit | 1a26bcf4f0b34f10c23d0ca46b9bec72a4a956df | [log] [tgz] |
---|---|---|
author | Colm O hEigeartaigh <coheigea@apache.org> | Wed Jul 20 11:56:13 2016 +0100 |
committer | Colm O hEigeartaigh <coheigea@apache.org> | Wed Jul 20 11:56:13 2016 +0100 |
tree | 3f0ab4f1eca20e8ef64442c8a049cc598c8d09f3 | |
parent | d280bce7ca5d8751a285a541c424781a517b6b3f [diff] |
Fixing NPE if no key alias
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 @@ 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);