ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1804683 - /webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
Date Thu, 10 Aug 2017 16:05:33 GMT
Author: coheigea
Date: Thu Aug 10 16:05:33 2017
New Revision: 1804683

URL: http://svn.apache.org/viewvc?rev=1804683&view=rev
Log:
Support ECDSA keys by default for signing in SamlAssertionWrapper

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1804683&r1=1804682&r2=1804683&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
(original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
Thu Aug 10 16:05:33 2017
@@ -119,6 +119,11 @@ public class SamlAssertionWrapper {
     private final String defaultDSASignatureAlgorithm = SignatureConstants.ALGO_ID_SIGNATURE_DSA;
 
     /**
+     * Default ECDSA Signature algorithm used for signing.
+     */
+    private final String defaultECDSASignatureAlgorithm = SignatureConstants.ALGO_ID_SIGNATURE_ECDSA_SHA1;
+
+    /**
      * Default Signature Digest algorithm
      */
     private final String defaultSignatureDigestAlgorithm = SignatureConstants.ALGO_ID_DIGEST_SHA1;
@@ -269,7 +274,7 @@ public class SamlAssertionWrapper {
         }
         return null;
     }
-    
+
     public Instant getNotOnOrAfter() {
         DateTime validTill = null;
         if (getSamlVersion().equals(SAMLVersion.VERSION_20)) {
@@ -551,6 +556,8 @@ public class SamlAssertionWrapper {
         LOG.debug("automatic sig algo detection: {}", pubKeyAlgo);
         if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
             sigAlgo = defaultDSASignatureAlgorithm;
+        } else if (pubKeyAlgo.equalsIgnoreCase("EC")) {
+            sigAlgo = defaultECDSASignatureAlgorithm;
         }
         LOG.debug("Using Signature algorithm {}", sigAlgo);
         PrivateKey privateKey;



Mime
View raw message