cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject svn commit: r1457480 - /cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Date Sun, 17 Mar 2013 16:24:13 GMT
Author: ashakirin
Date: Sun Mar 17 16:24:13 2013
New Revision: 1457480

URL: http://svn.apache.org/r1457480
Log:
Fixed [CXF-4897]

Modified:
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java

Modified: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java?rev=1457480&r1=1457479&r2=1457480&view=diff
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
(original)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Sun Mar 17 16:24:13 2013
@@ -137,9 +137,13 @@ public class DefaultSubjectProvider impl
             }
             cryptoType.setAlias(encryptionName);
             try {
-                X509Certificate certificate = crypto.getX509Certificates(cryptoType)[0];
+                X509Certificate[] certs = crypto.getX509Certificates(cryptoType);
+                if (certs == null || certs.length <= 0) {
+                    new STSException("Encryption certificate is not found for alias: " +
encryptionName,
+                                     STSException.REQUEST_FAILED);
+                }
                 KeyInfoBean keyInfo = 
-                    createKeyInfo(certificate, secret, doc, encryptionProperties, crypto);
+                    createKeyInfo(certs[0], secret, doc, encryptionProperties, crypto);
                 subjectBean.setKeyInfo(keyInfo);
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);



Mime
View raw message