cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1458229 - /cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Date Tue, 19 Mar 2013 11:26:12 GMT
Author: coheigea
Date: Tue Mar 19 11:26:11 2013
New Revision: 1458229

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

Modified:
    cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java

Modified: cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java?rev=1458229&r1=1458228&r2=1458229&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
(original)
+++ cxf/branches/wss4j2.0-port/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
Tue Mar 19 11:26:11 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