You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by "Jay Blanton (JIRA)" <ji...@apache.org> on 2009/10/21 22:56:59 UTC

[jira] Created: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
-----------------------------------------------------------------------------------------------------------

                 Key: WSS-213
                 URL: https://issues.apache.org/jira/browse/WSS-213
             Project: WSS4J
          Issue Type: Bug
    Affects Versions: 1.5.8
         Environment: OS = Ubuntu 9.04
Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
            Reporter: Jay Blanton
            Assignee: Ruchith Udayanga Fernando
            Priority: Critical


I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.

I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).

Then I try to run TestWSSecurityNewST2 and it fails.

This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).

I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Ping Web Service Client
[INFO]
[INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
url = http://repo1.maven.org/maven2
Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://static.appfuse.org/repository
Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://repository.jboss.com/maven2
Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
[INFO] [compiler:compile]
[INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
url = http://repo1.maven.org/maven2
Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://static.appfuse.org/repository
Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://repository.jboss.com/maven2
Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
[INFO] [jibx:bind]
[INFO] Not running JiBX binding compiler (single-module mode) - no binding files
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
url = http://repo1.maven.org/maven2
Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://static.appfuse.org/repository
Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://repository.jboss.com/maven2
Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
[INFO] [compiler:testCompile]
[INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
url = http://repo1.maven.org/maven2
Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://static.appfuse.org/repository
Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
url = http://repository.jboss.com/maven2
Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running wssec.TestWSSecurityNewST2
DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!

Results :

Tests in error:
  testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
  testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
  testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
  testWSS62(wssec.TestWSSecurityNewST2)

Tests run: 5, Failures: 0, Errors: 5, Skipped: 0

[ERROR]

Mojo:

    org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test

FAILED for project:

    com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT

Reason:

There are test failures.

Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run with the -e flag
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILED
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
[INFO] Final Memory: 4M/25M
[INFO] ------------------------------------------------------------------------

Here is the errors from the test report:
-------------------------------------------------------------------------------
Test set: wssec.TestWSSecurityNewST2
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
        at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
        at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
        at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)

testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
        at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
        at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
        at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)

testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
        at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
        at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
        at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)

testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
        at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
        at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
        at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Resolved: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh resolved WSS-213.
-------------------------------------

    Resolution: Won't Fix


Marking as won't fix, as the original issue has been resolved.

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Updated: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jay Blanton updated WSS-213:
----------------------------

    Attachment: wss4j.saml.tar.gz

So there is where I got.

With the new classes from 1.5.9-SNAPSHOT, my test works and I no longer have the "General security certificate" error.

The oddity is that the tests work under the Open JDK 1.6, but Sun's Version of the JDK 1.6 causes NullPointerExceptions when I run my test class.

I have included my project whch is just a slimmed down version of one of the tests you have provided.

Thanks for your help....jay

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772002#action_12772002 ] 

Jay Blanton commented on WSS-213:
---------------------------------

Colm...thanks again for your help.

Here is a sample class for background.

This is a class we built with BEA support so that we could implement SAML Sender Vouches (version 1.1) and just a digital signature of the SAML Assertion.

It uses just OpenSAML.

package foo.opensaml;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.xml.security.signature.XMLSignature;
import org.opensaml.SAMLAssertion;
import org.opensaml.SAMLAttribute;
import org.opensaml.SAMLAttributeStatement;
import org.opensaml.SAMLAuthenticationStatement;
import org.opensaml.SAMLException;
import org.opensaml.SAMLNameIdentifier;
import org.opensaml.SAMLResponse;
import org.opensaml.SAMLSignedObject;
import org.opensaml.SAMLSubject;
import org.opensaml.SAMLSubjectStatement;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;

/**
 * The Class SAMLAuthenticationHandler.
 */
public class SAMLAuthenticationHandler {
	/** The Constant ASSERTION_ISSUER. */
	public static final String ASSERTION_ISSUER = "assertion.issuer";

	/** The Constant CERTIFICATE_PASSWORD. */
	public static final String CERTIFICATE_PASSWORD = "certificate.password";

	/** The Constant CERTIFICATE_ALIAS. */
	public static final String CERTIFICATE_ALIAS = "certificate.alias";

	/** The Constant CERTIFICATE_KEYSTORE_PATH. */
	public static final String CERTIFICATE_KEYSTORE_PATH = "certificate.keystore.path";

	/** The Constant ASSERTION_SIGN. */
	public static final String ASSERTION_SIGN = "assertion.sign";

	/** The Constant ASSERTION_USERNAME. */
	public static final String ASSERTION_USERNAME = "assertion.username";

	/** The Constant SIGNATURE_INCLUDECERT. */
	public static final String SIGNATURE_INCLUDECERT = "signature.includecert";

	/** The Constant SAML_ASSERTION. */
	public static final String SAML_ASSERTION = "SAML.Assertion";

	/** The Constant SAML_ASSERTION_CERTPATH. */
	public static final String SAML_ASSERTION_CERTPATH = "SAML.Assertion.Certpath";

	private String credentialType = SAML_ASSERTION;

	private String assertionUserName;

	private boolean signAssertion = false;

	private Set<?> groups = Collections.EMPTY_SET;

	private long notBeforeMs;

	private long notAfterMs;

	private String certKeystorePath;

	private String certKeystoreType = "JKS";

	private String certAlias;

	private String certPassword;

	private String assertionIssuer;

	private String recipient;

	/**
	 * Instantiates a new SAML authentication handler.
	 * 
	 * @param config
	 *            the config
	 */
	public SAMLAuthenticationHandler() {
		super();
	}

	/**
	 * Handle request.
	 * 
	 * @return the SOAP header block
	 */
	public String getSamlAssertion() {

		String assertion = getSAMLAssertion(assertionUserName, // username
		        groups, // groups
		        signAssertion, // isSigned
		        notBeforeMs, // not before condition
		        notAfterMs, // not after condition
		        certKeystorePath, // keystore uri
		        certKeystoreType, // trusted keystore type
		        certAlias, // trusted cert alias
		        certPassword, // trusted cert alias password
		        credentialType, // credentialType
		        assertionIssuer, // issuerURI
		        recipient // recipient
		);

		System.out.println(assertion);

		return assertion;
	}

	public String getCredentialType() {
		return credentialType;
	}

	public void setCredentialType(String credentialType) {
		this.credentialType = credentialType;
	}

	public String getAssertionUserName() {
		return assertionUserName;
	}

	public void setAssertionUserName(String assertionUserName) {
		this.assertionUserName = assertionUserName;
	}

	public boolean isSignAssertion() {
		return signAssertion;
	}

	public void setSignAssertion(boolean signAssertion) {
		this.signAssertion = signAssertion;
	}

	public void setSignAssertion(String signAssertion) {
		this.signAssertion = BooleanUtils.toBoolean(signAssertion);
	}

	public Set<?> getGroups() {
		return groups;
	}

	public void setGroups(Set<?> groups) {
		this.groups = groups;
	}

	public long getNotBeforeMs() {
		return notBeforeMs;
	}

	public void setNotBeforeMs(long notBeforeMs) {
		this.notBeforeMs = notBeforeMs;
	}

	public long getNotAfterMs() {
		return notAfterMs;
	}

	public void setNotAfterMs(long notAfterMs) {
		this.notAfterMs = notAfterMs;
	}

	public String getCertKeystorePath() {
		return certKeystorePath;
	}

	public void setCertKeystorePath(String certKeystorePath) {
		this.certKeystorePath = certKeystorePath;
	}

	public String getCertKeystoreType() {
		return certKeystoreType;
	}

	public void setCertKeystoreType(String certKeystoreType) {
		this.certKeystoreType = certKeystoreType;
	}

	public String getCertAlias() {
		return certAlias;
	}

	public void setCertAlias(String certAlias) {
		this.certAlias = certAlias;
	}

	public String getCertPassword() {
		return certPassword;
	}

	public void setCertPassword(String certPassword) {
		this.certPassword = certPassword;
	}

	public String getAssertionIssuer() {
		return assertionIssuer;
	}

	public void setAssertionIssuer(String assertionIssuer) {
		this.assertionIssuer = assertionIssuer;
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	/** The Constant UNKNOWN_RECIPIENT. */
	public static final String UNKNOWN_RECIPIENT = "unknown";

	/** The Constant SAML_RESPONSE. */
	public static final String SAML_RESPONSE = "SAML.Profile.POST";

	/** The Constant SAML_RESPONSE_CERTPATH. */
	public static final String SAML_RESPONSE_CERTPATH = "SAML.Profile.POST.Certpath";

	/** The Constant SAML_RESPONSE_NO_CERTPATH. */
	public static final String SAML_RESPONSE_NO_CERTPATH = "SAML.Profile.POST.NoCertpath";

	/** The Constant WLES_GROUP_TAG. */
	private static final String WLES_GROUP_TAG = "WLESGroup";

	/** The Constant WLES_GROUP_NS. */
	private static final String WLES_GROUP_NS = "urn:bea:security:saml:groups";

	/**
	 * Gets the SAML assertion.
	 * 
	 * @param userName
	 *            the user name
	 * @param groups
	 *            the groups
	 * @param isSigned
	 *            the is signed
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param trustedKeystore
	 *            the trusted keystore
	 * @param trustedKeystoreType
	 *            the trusted keystore type
	 * @param trustedCertAlias
	 *            the trusted cert alias
	 * @param trustedCertAliasPasswd
	 *            the trusted cert alias passwd
	 * @param credentialType
	 *            the credential type
	 * @param issuer
	 *            the issuer
	 * @param recipient
	 *            the recipient
	 * 
	 * @return the SAML assertion
	 */
	public String getSAMLAssertion(String userName, Set<?> groups,
	        boolean isSigned, long notBeforeMs, long notAfterMs,
	        String trustedKeystore, String trustedKeystoreType,
	        String trustedCertAlias, String trustedCertAliasPasswd,
	        String credentialType, String issuer, String recipient) {
		boolean asResponse = isResponseType(credentialType);
		boolean withCertPath = requireCertpath(credentialType);

		ClassLoader dirCLDR = this.getClass().getClassLoader();
		ClassLoader threadCLDR = Thread.currentThread().getContextClassLoader();

		try {
			Thread.currentThread().setContextClassLoader(dirCLDR);

			SAMLSubject subject = new SAMLSubject(new SAMLNameIdentifier(
			        userName, null, null), Collections
			        .singleton(SAMLSubject.CONF_SENDER_VOUCHES), null, null);

			SAMLAttributeStatement attrStat = null;

			if ((groups != null) && (groups.size() != 0)) {
				attrStat = createAttributeStatement(subject, groups);
			}

			SAMLAssertion assertion = createAssertion(
			        createAuthenticationStatement(subject), attrStat,
			        notBeforeMs, notAfterMs, issuer);

			SAMLSignedObject signedObject = null;

			if (asResponse) {
				List<SAMLAssertion> assertionList = new ArrayList<SAMLAssertion>();
				assertionList.add(assertion);

				String responseRecipient = recipient;
				if (StringUtils.isEmpty(recipient)) {
					responseRecipient = UNKNOWN_RECIPIENT;
				}

				SAMLResponse response = new SAMLResponse(null,
				        responseRecipient, assertionList, null);

				if (isSigned) {
					signedObject = getSignedAssertion(response,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}
			else {
				if (isSigned) {
					signedObject = getSignedAssertion(assertion,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}

			if (signedObject != null) {
				return signedObject.toString();
			}
			else {
				return assertion.toString();
			}
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			Thread.currentThread().setContextClassLoader(threadCLDR);
		}
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param authnStat
	 *            the authn stat
	 * @param attrStat
	 *            the attr stat
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param issuer
	 *            the issuer
	 * 
	 * @return the SAML assertion
	 */
	private SAMLAssertion createAssertion(
	        SAMLAuthenticationStatement authnStat,
	        SAMLAttributeStatement attrStat, long notBeforeMs, long notAfterMs,
	        String issuer) {
		SAMLAssertion samlAssertion = null;
		long now = System.currentTimeMillis();
		Date notBefore = new Date(now - notBeforeMs);
		Date notOnOrAfter = new Date(now + notAfterMs);

		List<SAMLSubjectStatement> statements = new ArrayList<SAMLSubjectStatement>();

		if (authnStat != null) {
			statements.add(authnStat);
		}

		if (attrStat != null) {
			statements.add(attrStat);
		}

		try {
			samlAssertion = new SAMLAssertion(issuer, notBefore, notOnOrAfter,
			        null, null, statements);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}

		return samlAssertion;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * @param groups
	 *            the groups
	 * 
	 * @return the SAML attribute statement
	 */
	private SAMLAttributeStatement createAttributeStatement(
	        SAMLSubject subject, Collection<?> groups) {
		SAMLAttributeStatement attrStmt = null;

		try {
			SAMLAttribute wlesGroup = new SAMLAttribute(WLES_GROUP_TAG,
			        WLES_GROUP_NS, null, 0, groups);

			ArrayList<SAMLAttribute> wlesGroups = new ArrayList<SAMLAttribute>();
			wlesGroups.add(wlesGroup);

			attrStmt = new SAMLAttributeStatement(
			        (SAMLSubject) subject.clone(), wlesGroups);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return attrStmt;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * 
	 * @return the SAML authentication statement
	 */
	private SAMLAuthenticationStatement createAuthenticationStatement(
	        SAMLSubject subject) {
		String authnMtd = SAMLAuthenticationStatement.AuthenticationMethod_Password;
		SAMLAuthenticationStatement authnStat = null;

		try {
			authnStat = new SAMLAuthenticationStatement((SAMLSubject) subject
			        .clone(), authnMtd, new Date(), null, null, null);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return authnStat;
	}

	/**
	 * Gets the signed assertion.
	 * 
	 * @param assertion
	 *            the assertion
	 * @param keyStoreFilename
	 *            the key store filename
	 * @param keyStoreType
	 *            the key store type
	 * @param certAlias
	 *            the cert alias
	 * @param certPswd
	 *            the cert pswd
	 * @param includeCertpath
	 *            the include certpath
	 * @param isResponse
	 *            the is response
	 * 
	 * @return the signed assertion
	 */
	private SAMLSignedObject getSignedAssertion(SAMLSignedObject assertion,
	        String keyStoreFilename, String keyStoreType, String certAlias,
	        String certPswd, boolean includeCertpath, boolean isResponse) {
		if (StringUtils.isEmpty(keyStoreFilename)) {
			throw new SecurityException(
			        "keyStoreFilename is either null or empty string");
		}

		if (StringUtils.isEmpty(keyStoreType)) {
			throw new SecurityException("keyStoreType is either null or empty");
		}

		if (StringUtils.isEmpty(certAlias)) {
			throw new SecurityException("certAlias is either null or empty");
		}

		if (StringUtils.isEmpty(certPswd)) {
			throw new SecurityException("certPswd is either null or empty");
		}

		FileInputStream fin = null;

		try {
			KeyStore store = KeyStore.getInstance(keyStoreType);
			ResourceLoader rs = new DefaultResourceLoader();
			ClassPathResource resource = (ClassPathResource) rs
			        .getResource(keyStoreFilename);
			fin = new FileInputStream(resource.getFile());
			store.load(fin, null);

			Key privateKey = store.getKey(certAlias, certPswd.toCharArray());

			if (privateKey != null) {
				List<Certificate> certs = new ArrayList<Certificate>();

				if (includeCertpath) {
					if (isResponse) {
						Certificate cert = store.getCertificate(certAlias);

						if (cert == null) {
							throw new SecurityException(
							        "unable to get certificate using certAlias");
						}

						certs.add(cert);
					}
					else {
						Certificate certArray[] = store
						        .getCertificateChain(certAlias);

						if (certArray == null) {
							throw new SecurityException(
							        "unable to get certificate chain using certAlias");
						}

						certs.addAll(Arrays.asList(certArray));
					}

					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, certs);
				}
				else {
					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, null);
				}
			}
			else {
				throw new SecurityException(
				        "private key was null and hence cannot sign assertion");
			}
		}
		catch (KeyStoreException e) {
			throw new RuntimeException(e);
		}
		catch (FileNotFoundException e) {
			throw new RuntimeException(e);
		}
		catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		}
		catch (CertificateException e) {
			throw new RuntimeException(e);
		}
		catch (UnrecoverableKeyException e) {
			throw new RuntimeException(e);
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			IOUtils.closeQuietly(fin);
		}

		return assertion;
	}

	/**
	 * Checks if is response type.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if is response type
	 */
	private boolean isResponseType(String credentialTypes) {
		boolean responseType = false;

		if (SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE_NO_CERTPATH.equals(credentialTypes)) {
			responseType = true;
		}

		return responseType;
	}

	/**
	 * Require certpath.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if successful
	 */
	private boolean requireCertpath(String credentialTypes) {
		boolean requireCertpath = false;

		if (SAML_ASSERTION_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)) {
			requireCertpath = true;
		}

		return requireCertpath;
	}

}

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768685#action_12768685 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


Do you have strong crypto installed? What kind of environment are you running the tests in? It looks odd...what are the xws imports doing there?

Try this:

svn co http://svn.apache.org/repos/asf/webservices/wss4j/branches/1_5_x-fixes
cd 1_5_x-fixes
mvn clean install

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768783#action_12768783 ] 

Jay Blanton commented on WSS-213:
---------------------------------

I not sure about the strong crypto?

Sorry for some of the confusion, I am currently pulling the test case into its own project so I can attach it here.

Right now it is implemented inside of a Spring project I have and that is why there are xws imports being displayed.

I will update this ticket with the additional information.

There is one interesting thing, the svn co and clean/install worked based on which JDK I used:

1) This version worked:
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
OpenJDK Client VM (build 14.0-b08, mixed mode, sharing)
2) This version did not worked and the tests failed:
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

Should it matter what version of the jdk that I am running?

Thanks...jay


> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769176#action_12769176 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


You need to install the Unlimited Strength JCE Policy files 6 from here:

http://java.sun.com/javase/downloads/index.jsp

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Issue Comment Edited: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772002#action_12772002 ] 

Jay Blanton edited comment on WSS-213 at 10/30/09 5:35 PM:
-----------------------------------------------------------

Colm...thanks again for your help.

Here is a sample class for background.

This is a class we built with BEA support so that we could implement SAML Sender Vouches (version 1.1) and just a digital signature of the SAML Assertion.

We currently use this class on the Service Client side to attach SAML Tokens onto the service request and this is then resolved in the Oracle Service Bus and the WSDL hosted on that Bus.

It uses just OpenSAML.

package foo.opensaml;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.xml.security.signature.XMLSignature;
import org.opensaml.SAMLAssertion;
import org.opensaml.SAMLAttribute;
import org.opensaml.SAMLAttributeStatement;
import org.opensaml.SAMLAuthenticationStatement;
import org.opensaml.SAMLException;
import org.opensaml.SAMLNameIdentifier;
import org.opensaml.SAMLResponse;
import org.opensaml.SAMLSignedObject;
import org.opensaml.SAMLSubject;
import org.opensaml.SAMLSubjectStatement;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;

/**
 * The Class SAMLAuthenticationHandler.
 */
public class SAMLAuthenticationHandler {
	/** The Constant ASSERTION_ISSUER. */
	public static final String ASSERTION_ISSUER = "assertion.issuer";

	/** The Constant CERTIFICATE_PASSWORD. */
	public static final String CERTIFICATE_PASSWORD = "certificate.password";

	/** The Constant CERTIFICATE_ALIAS. */
	public static final String CERTIFICATE_ALIAS = "certificate.alias";

	/** The Constant CERTIFICATE_KEYSTORE_PATH. */
	public static final String CERTIFICATE_KEYSTORE_PATH = "certificate.keystore.path";

	/** The Constant ASSERTION_SIGN. */
	public static final String ASSERTION_SIGN = "assertion.sign";

	/** The Constant ASSERTION_USERNAME. */
	public static final String ASSERTION_USERNAME = "assertion.username";

	/** The Constant SIGNATURE_INCLUDECERT. */
	public static final String SIGNATURE_INCLUDECERT = "signature.includecert";

	/** The Constant SAML_ASSERTION. */
	public static final String SAML_ASSERTION = "SAML.Assertion";

	/** The Constant SAML_ASSERTION_CERTPATH. */
	public static final String SAML_ASSERTION_CERTPATH = "SAML.Assertion.Certpath";

	private String credentialType = SAML_ASSERTION;

	private String assertionUserName;

	private boolean signAssertion = false;

	private Set<?> groups = Collections.EMPTY_SET;

	private long notBeforeMs;

	private long notAfterMs;

	private String certKeystorePath;

	private String certKeystoreType = "JKS";

	private String certAlias;

	private String certPassword;

	private String assertionIssuer;

	private String recipient;

	/**
	 * Instantiates a new SAML authentication handler.
	 * 
	 * @param config
	 *            the config
	 */
	public SAMLAuthenticationHandler() {
		super();
	}

	/**
	 * Handle request.
	 * 
	 * @return the SOAP header block
	 */
	public String getSamlAssertion() {

		String assertion = getSAMLAssertion(assertionUserName, // username
		        groups, // groups
		        signAssertion, // isSigned
		        notBeforeMs, // not before condition
		        notAfterMs, // not after condition
		        certKeystorePath, // keystore uri
		        certKeystoreType, // trusted keystore type
		        certAlias, // trusted cert alias
		        certPassword, // trusted cert alias password
		        credentialType, // credentialType
		        assertionIssuer, // issuerURI
		        recipient // recipient
		);

		System.out.println(assertion);

		return assertion;
	}

	public String getCredentialType() {
		return credentialType;
	}

	public void setCredentialType(String credentialType) {
		this.credentialType = credentialType;
	}

	public String getAssertionUserName() {
		return assertionUserName;
	}

	public void setAssertionUserName(String assertionUserName) {
		this.assertionUserName = assertionUserName;
	}

	public boolean isSignAssertion() {
		return signAssertion;
	}

	public void setSignAssertion(boolean signAssertion) {
		this.signAssertion = signAssertion;
	}

	public void setSignAssertion(String signAssertion) {
		this.signAssertion = BooleanUtils.toBoolean(signAssertion);
	}

	public Set<?> getGroups() {
		return groups;
	}

	public void setGroups(Set<?> groups) {
		this.groups = groups;
	}

	public long getNotBeforeMs() {
		return notBeforeMs;
	}

	public void setNotBeforeMs(long notBeforeMs) {
		this.notBeforeMs = notBeforeMs;
	}

	public long getNotAfterMs() {
		return notAfterMs;
	}

	public void setNotAfterMs(long notAfterMs) {
		this.notAfterMs = notAfterMs;
	}

	public String getCertKeystorePath() {
		return certKeystorePath;
	}

	public void setCertKeystorePath(String certKeystorePath) {
		this.certKeystorePath = certKeystorePath;
	}

	public String getCertKeystoreType() {
		return certKeystoreType;
	}

	public void setCertKeystoreType(String certKeystoreType) {
		this.certKeystoreType = certKeystoreType;
	}

	public String getCertAlias() {
		return certAlias;
	}

	public void setCertAlias(String certAlias) {
		this.certAlias = certAlias;
	}

	public String getCertPassword() {
		return certPassword;
	}

	public void setCertPassword(String certPassword) {
		this.certPassword = certPassword;
	}

	public String getAssertionIssuer() {
		return assertionIssuer;
	}

	public void setAssertionIssuer(String assertionIssuer) {
		this.assertionIssuer = assertionIssuer;
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	/** The Constant UNKNOWN_RECIPIENT. */
	public static final String UNKNOWN_RECIPIENT = "unknown";

	/** The Constant SAML_RESPONSE. */
	public static final String SAML_RESPONSE = "SAML.Profile.POST";

	/** The Constant SAML_RESPONSE_CERTPATH. */
	public static final String SAML_RESPONSE_CERTPATH = "SAML.Profile.POST.Certpath";

	/** The Constant SAML_RESPONSE_NO_CERTPATH. */
	public static final String SAML_RESPONSE_NO_CERTPATH = "SAML.Profile.POST.NoCertpath";

	/** The Constant WLES_GROUP_TAG. */
	private static final String WLES_GROUP_TAG = "WLESGroup";

	/** The Constant WLES_GROUP_NS. */
	private static final String WLES_GROUP_NS = "urn:bea:security:saml:groups";

	/**
	 * Gets the SAML assertion.
	 * 
	 * @param userName
	 *            the user name
	 * @param groups
	 *            the groups
	 * @param isSigned
	 *            the is signed
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param trustedKeystore
	 *            the trusted keystore
	 * @param trustedKeystoreType
	 *            the trusted keystore type
	 * @param trustedCertAlias
	 *            the trusted cert alias
	 * @param trustedCertAliasPasswd
	 *            the trusted cert alias passwd
	 * @param credentialType
	 *            the credential type
	 * @param issuer
	 *            the issuer
	 * @param recipient
	 *            the recipient
	 * 
	 * @return the SAML assertion
	 */
	public String getSAMLAssertion(String userName, Set<?> groups,
	        boolean isSigned, long notBeforeMs, long notAfterMs,
	        String trustedKeystore, String trustedKeystoreType,
	        String trustedCertAlias, String trustedCertAliasPasswd,
	        String credentialType, String issuer, String recipient) {
		boolean asResponse = isResponseType(credentialType);
		boolean withCertPath = requireCertpath(credentialType);

		ClassLoader dirCLDR = this.getClass().getClassLoader();
		ClassLoader threadCLDR = Thread.currentThread().getContextClassLoader();

		try {
			Thread.currentThread().setContextClassLoader(dirCLDR);

			SAMLSubject subject = new SAMLSubject(new SAMLNameIdentifier(
			        userName, null, null), Collections
			        .singleton(SAMLSubject.CONF_SENDER_VOUCHES), null, null);

			SAMLAttributeStatement attrStat = null;

			if ((groups != null) && (groups.size() != 0)) {
				attrStat = createAttributeStatement(subject, groups);
			}

			SAMLAssertion assertion = createAssertion(
			        createAuthenticationStatement(subject), attrStat,
			        notBeforeMs, notAfterMs, issuer);

			SAMLSignedObject signedObject = null;

			if (asResponse) {
				List<SAMLAssertion> assertionList = new ArrayList<SAMLAssertion>();
				assertionList.add(assertion);

				String responseRecipient = recipient;
				if (StringUtils.isEmpty(recipient)) {
					responseRecipient = UNKNOWN_RECIPIENT;
				}

				SAMLResponse response = new SAMLResponse(null,
				        responseRecipient, assertionList, null);

				if (isSigned) {
					signedObject = getSignedAssertion(response,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}
			else {
				if (isSigned) {
					signedObject = getSignedAssertion(assertion,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}

			if (signedObject != null) {
				return signedObject.toString();
			}
			else {
				return assertion.toString();
			}
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			Thread.currentThread().setContextClassLoader(threadCLDR);
		}
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param authnStat
	 *            the authn stat
	 * @param attrStat
	 *            the attr stat
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param issuer
	 *            the issuer
	 * 
	 * @return the SAML assertion
	 */
	private SAMLAssertion createAssertion(
	        SAMLAuthenticationStatement authnStat,
	        SAMLAttributeStatement attrStat, long notBeforeMs, long notAfterMs,
	        String issuer) {
		SAMLAssertion samlAssertion = null;
		long now = System.currentTimeMillis();
		Date notBefore = new Date(now - notBeforeMs);
		Date notOnOrAfter = new Date(now + notAfterMs);

		List<SAMLSubjectStatement> statements = new ArrayList<SAMLSubjectStatement>();

		if (authnStat != null) {
			statements.add(authnStat);
		}

		if (attrStat != null) {
			statements.add(attrStat);
		}

		try {
			samlAssertion = new SAMLAssertion(issuer, notBefore, notOnOrAfter,
			        null, null, statements);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}

		return samlAssertion;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * @param groups
	 *            the groups
	 * 
	 * @return the SAML attribute statement
	 */
	private SAMLAttributeStatement createAttributeStatement(
	        SAMLSubject subject, Collection<?> groups) {
		SAMLAttributeStatement attrStmt = null;

		try {
			SAMLAttribute wlesGroup = new SAMLAttribute(WLES_GROUP_TAG,
			        WLES_GROUP_NS, null, 0, groups);

			ArrayList<SAMLAttribute> wlesGroups = new ArrayList<SAMLAttribute>();
			wlesGroups.add(wlesGroup);

			attrStmt = new SAMLAttributeStatement(
			        (SAMLSubject) subject.clone(), wlesGroups);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return attrStmt;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * 
	 * @return the SAML authentication statement
	 */
	private SAMLAuthenticationStatement createAuthenticationStatement(
	        SAMLSubject subject) {
		String authnMtd = SAMLAuthenticationStatement.AuthenticationMethod_Password;
		SAMLAuthenticationStatement authnStat = null;

		try {
			authnStat = new SAMLAuthenticationStatement((SAMLSubject) subject
			        .clone(), authnMtd, new Date(), null, null, null);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return authnStat;
	}

	/**
	 * Gets the signed assertion.
	 * 
	 * @param assertion
	 *            the assertion
	 * @param keyStoreFilename
	 *            the key store filename
	 * @param keyStoreType
	 *            the key store type
	 * @param certAlias
	 *            the cert alias
	 * @param certPswd
	 *            the cert pswd
	 * @param includeCertpath
	 *            the include certpath
	 * @param isResponse
	 *            the is response
	 * 
	 * @return the signed assertion
	 */
	private SAMLSignedObject getSignedAssertion(SAMLSignedObject assertion,
	        String keyStoreFilename, String keyStoreType, String certAlias,
	        String certPswd, boolean includeCertpath, boolean isResponse) {
		if (StringUtils.isEmpty(keyStoreFilename)) {
			throw new SecurityException(
			        "keyStoreFilename is either null or empty string");
		}

		if (StringUtils.isEmpty(keyStoreType)) {
			throw new SecurityException("keyStoreType is either null or empty");
		}

		if (StringUtils.isEmpty(certAlias)) {
			throw new SecurityException("certAlias is either null or empty");
		}

		if (StringUtils.isEmpty(certPswd)) {
			throw new SecurityException("certPswd is either null or empty");
		}

		FileInputStream fin = null;

		try {
			KeyStore store = KeyStore.getInstance(keyStoreType);
			ResourceLoader rs = new DefaultResourceLoader();
			ClassPathResource resource = (ClassPathResource) rs
			        .getResource(keyStoreFilename);
			fin = new FileInputStream(resource.getFile());
			store.load(fin, null);

			Key privateKey = store.getKey(certAlias, certPswd.toCharArray());

			if (privateKey != null) {
				List<Certificate> certs = new ArrayList<Certificate>();

				if (includeCertpath) {
					if (isResponse) {
						Certificate cert = store.getCertificate(certAlias);

						if (cert == null) {
							throw new SecurityException(
							        "unable to get certificate using certAlias");
						}

						certs.add(cert);
					}
					else {
						Certificate certArray[] = store
						        .getCertificateChain(certAlias);

						if (certArray == null) {
							throw new SecurityException(
							        "unable to get certificate chain using certAlias");
						}

						certs.addAll(Arrays.asList(certArray));
					}

					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, certs);
				}
				else {
					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, null);
				}
			}
			else {
				throw new SecurityException(
				        "private key was null and hence cannot sign assertion");
			}
		}
		catch (KeyStoreException e) {
			throw new RuntimeException(e);
		}
		catch (FileNotFoundException e) {
			throw new RuntimeException(e);
		}
		catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		}
		catch (CertificateException e) {
			throw new RuntimeException(e);
		}
		catch (UnrecoverableKeyException e) {
			throw new RuntimeException(e);
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			IOUtils.closeQuietly(fin);
		}

		return assertion;
	}

	/**
	 * Checks if is response type.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if is response type
	 */
	private boolean isResponseType(String credentialTypes) {
		boolean responseType = false;

		if (SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE_NO_CERTPATH.equals(credentialTypes)) {
			responseType = true;
		}

		return responseType;
	}

	/**
	 * Require certpath.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if successful
	 */
	private boolean requireCertpath(String credentialTypes) {
		boolean requireCertpath = false;

		if (SAML_ASSERTION_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)) {
			requireCertpath = true;
		}

		return requireCertpath;
	}

}

      was (Author: jaybytez):
    Colm...thanks again for your help.

Here is a sample class for background.

This is a class we built with BEA support so that we could implement SAML Sender Vouches (version 1.1) and just a digital signature of the SAML Assertion.

It uses just OpenSAML.

package foo.opensaml;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.xml.security.signature.XMLSignature;
import org.opensaml.SAMLAssertion;
import org.opensaml.SAMLAttribute;
import org.opensaml.SAMLAttributeStatement;
import org.opensaml.SAMLAuthenticationStatement;
import org.opensaml.SAMLException;
import org.opensaml.SAMLNameIdentifier;
import org.opensaml.SAMLResponse;
import org.opensaml.SAMLSignedObject;
import org.opensaml.SAMLSubject;
import org.opensaml.SAMLSubjectStatement;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.ResourceLoader;

/**
 * The Class SAMLAuthenticationHandler.
 */
public class SAMLAuthenticationHandler {
	/** The Constant ASSERTION_ISSUER. */
	public static final String ASSERTION_ISSUER = "assertion.issuer";

	/** The Constant CERTIFICATE_PASSWORD. */
	public static final String CERTIFICATE_PASSWORD = "certificate.password";

	/** The Constant CERTIFICATE_ALIAS. */
	public static final String CERTIFICATE_ALIAS = "certificate.alias";

	/** The Constant CERTIFICATE_KEYSTORE_PATH. */
	public static final String CERTIFICATE_KEYSTORE_PATH = "certificate.keystore.path";

	/** The Constant ASSERTION_SIGN. */
	public static final String ASSERTION_SIGN = "assertion.sign";

	/** The Constant ASSERTION_USERNAME. */
	public static final String ASSERTION_USERNAME = "assertion.username";

	/** The Constant SIGNATURE_INCLUDECERT. */
	public static final String SIGNATURE_INCLUDECERT = "signature.includecert";

	/** The Constant SAML_ASSERTION. */
	public static final String SAML_ASSERTION = "SAML.Assertion";

	/** The Constant SAML_ASSERTION_CERTPATH. */
	public static final String SAML_ASSERTION_CERTPATH = "SAML.Assertion.Certpath";

	private String credentialType = SAML_ASSERTION;

	private String assertionUserName;

	private boolean signAssertion = false;

	private Set<?> groups = Collections.EMPTY_SET;

	private long notBeforeMs;

	private long notAfterMs;

	private String certKeystorePath;

	private String certKeystoreType = "JKS";

	private String certAlias;

	private String certPassword;

	private String assertionIssuer;

	private String recipient;

	/**
	 * Instantiates a new SAML authentication handler.
	 * 
	 * @param config
	 *            the config
	 */
	public SAMLAuthenticationHandler() {
		super();
	}

	/**
	 * Handle request.
	 * 
	 * @return the SOAP header block
	 */
	public String getSamlAssertion() {

		String assertion = getSAMLAssertion(assertionUserName, // username
		        groups, // groups
		        signAssertion, // isSigned
		        notBeforeMs, // not before condition
		        notAfterMs, // not after condition
		        certKeystorePath, // keystore uri
		        certKeystoreType, // trusted keystore type
		        certAlias, // trusted cert alias
		        certPassword, // trusted cert alias password
		        credentialType, // credentialType
		        assertionIssuer, // issuerURI
		        recipient // recipient
		);

		System.out.println(assertion);

		return assertion;
	}

	public String getCredentialType() {
		return credentialType;
	}

	public void setCredentialType(String credentialType) {
		this.credentialType = credentialType;
	}

	public String getAssertionUserName() {
		return assertionUserName;
	}

	public void setAssertionUserName(String assertionUserName) {
		this.assertionUserName = assertionUserName;
	}

	public boolean isSignAssertion() {
		return signAssertion;
	}

	public void setSignAssertion(boolean signAssertion) {
		this.signAssertion = signAssertion;
	}

	public void setSignAssertion(String signAssertion) {
		this.signAssertion = BooleanUtils.toBoolean(signAssertion);
	}

	public Set<?> getGroups() {
		return groups;
	}

	public void setGroups(Set<?> groups) {
		this.groups = groups;
	}

	public long getNotBeforeMs() {
		return notBeforeMs;
	}

	public void setNotBeforeMs(long notBeforeMs) {
		this.notBeforeMs = notBeforeMs;
	}

	public long getNotAfterMs() {
		return notAfterMs;
	}

	public void setNotAfterMs(long notAfterMs) {
		this.notAfterMs = notAfterMs;
	}

	public String getCertKeystorePath() {
		return certKeystorePath;
	}

	public void setCertKeystorePath(String certKeystorePath) {
		this.certKeystorePath = certKeystorePath;
	}

	public String getCertKeystoreType() {
		return certKeystoreType;
	}

	public void setCertKeystoreType(String certKeystoreType) {
		this.certKeystoreType = certKeystoreType;
	}

	public String getCertAlias() {
		return certAlias;
	}

	public void setCertAlias(String certAlias) {
		this.certAlias = certAlias;
	}

	public String getCertPassword() {
		return certPassword;
	}

	public void setCertPassword(String certPassword) {
		this.certPassword = certPassword;
	}

	public String getAssertionIssuer() {
		return assertionIssuer;
	}

	public void setAssertionIssuer(String assertionIssuer) {
		this.assertionIssuer = assertionIssuer;
	}

	public String getRecipient() {
		return recipient;
	}

	public void setRecipient(String recipient) {
		this.recipient = recipient;
	}

	/** The Constant UNKNOWN_RECIPIENT. */
	public static final String UNKNOWN_RECIPIENT = "unknown";

	/** The Constant SAML_RESPONSE. */
	public static final String SAML_RESPONSE = "SAML.Profile.POST";

	/** The Constant SAML_RESPONSE_CERTPATH. */
	public static final String SAML_RESPONSE_CERTPATH = "SAML.Profile.POST.Certpath";

	/** The Constant SAML_RESPONSE_NO_CERTPATH. */
	public static final String SAML_RESPONSE_NO_CERTPATH = "SAML.Profile.POST.NoCertpath";

	/** The Constant WLES_GROUP_TAG. */
	private static final String WLES_GROUP_TAG = "WLESGroup";

	/** The Constant WLES_GROUP_NS. */
	private static final String WLES_GROUP_NS = "urn:bea:security:saml:groups";

	/**
	 * Gets the SAML assertion.
	 * 
	 * @param userName
	 *            the user name
	 * @param groups
	 *            the groups
	 * @param isSigned
	 *            the is signed
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param trustedKeystore
	 *            the trusted keystore
	 * @param trustedKeystoreType
	 *            the trusted keystore type
	 * @param trustedCertAlias
	 *            the trusted cert alias
	 * @param trustedCertAliasPasswd
	 *            the trusted cert alias passwd
	 * @param credentialType
	 *            the credential type
	 * @param issuer
	 *            the issuer
	 * @param recipient
	 *            the recipient
	 * 
	 * @return the SAML assertion
	 */
	public String getSAMLAssertion(String userName, Set<?> groups,
	        boolean isSigned, long notBeforeMs, long notAfterMs,
	        String trustedKeystore, String trustedKeystoreType,
	        String trustedCertAlias, String trustedCertAliasPasswd,
	        String credentialType, String issuer, String recipient) {
		boolean asResponse = isResponseType(credentialType);
		boolean withCertPath = requireCertpath(credentialType);

		ClassLoader dirCLDR = this.getClass().getClassLoader();
		ClassLoader threadCLDR = Thread.currentThread().getContextClassLoader();

		try {
			Thread.currentThread().setContextClassLoader(dirCLDR);

			SAMLSubject subject = new SAMLSubject(new SAMLNameIdentifier(
			        userName, null, null), Collections
			        .singleton(SAMLSubject.CONF_SENDER_VOUCHES), null, null);

			SAMLAttributeStatement attrStat = null;

			if ((groups != null) && (groups.size() != 0)) {
				attrStat = createAttributeStatement(subject, groups);
			}

			SAMLAssertion assertion = createAssertion(
			        createAuthenticationStatement(subject), attrStat,
			        notBeforeMs, notAfterMs, issuer);

			SAMLSignedObject signedObject = null;

			if (asResponse) {
				List<SAMLAssertion> assertionList = new ArrayList<SAMLAssertion>();
				assertionList.add(assertion);

				String responseRecipient = recipient;
				if (StringUtils.isEmpty(recipient)) {
					responseRecipient = UNKNOWN_RECIPIENT;
				}

				SAMLResponse response = new SAMLResponse(null,
				        responseRecipient, assertionList, null);

				if (isSigned) {
					signedObject = getSignedAssertion(response,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}
			else {
				if (isSigned) {
					signedObject = getSignedAssertion(assertion,
					        trustedKeystore, trustedKeystoreType,
					        trustedCertAlias, trustedCertAliasPasswd,
					        withCertPath, asResponse);
				}
			}

			if (signedObject != null) {
				return signedObject.toString();
			}
			else {
				return assertion.toString();
			}
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			Thread.currentThread().setContextClassLoader(threadCLDR);
		}
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param authnStat
	 *            the authn stat
	 * @param attrStat
	 *            the attr stat
	 * @param notBeforeMs
	 *            the not before_ms
	 * @param notAfterMs
	 *            the not after_ms
	 * @param issuer
	 *            the issuer
	 * 
	 * @return the SAML assertion
	 */
	private SAMLAssertion createAssertion(
	        SAMLAuthenticationStatement authnStat,
	        SAMLAttributeStatement attrStat, long notBeforeMs, long notAfterMs,
	        String issuer) {
		SAMLAssertion samlAssertion = null;
		long now = System.currentTimeMillis();
		Date notBefore = new Date(now - notBeforeMs);
		Date notOnOrAfter = new Date(now + notAfterMs);

		List<SAMLSubjectStatement> statements = new ArrayList<SAMLSubjectStatement>();

		if (authnStat != null) {
			statements.add(authnStat);
		}

		if (attrStat != null) {
			statements.add(attrStat);
		}

		try {
			samlAssertion = new SAMLAssertion(issuer, notBefore, notOnOrAfter,
			        null, null, statements);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}

		return samlAssertion;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * @param groups
	 *            the groups
	 * 
	 * @return the SAML attribute statement
	 */
	private SAMLAttributeStatement createAttributeStatement(
	        SAMLSubject subject, Collection<?> groups) {
		SAMLAttributeStatement attrStmt = null;

		try {
			SAMLAttribute wlesGroup = new SAMLAttribute(WLES_GROUP_TAG,
			        WLES_GROUP_NS, null, 0, groups);

			ArrayList<SAMLAttribute> wlesGroups = new ArrayList<SAMLAttribute>();
			wlesGroups.add(wlesGroup);

			attrStmt = new SAMLAttributeStatement(
			        (SAMLSubject) subject.clone(), wlesGroups);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return attrStmt;
	}

	/**
	 * Creates a new SAMLToken object.
	 * 
	 * @param subject
	 *            the subject
	 * 
	 * @return the SAML authentication statement
	 */
	private SAMLAuthenticationStatement createAuthenticationStatement(
	        SAMLSubject subject) {
		String authnMtd = SAMLAuthenticationStatement.AuthenticationMethod_Password;
		SAMLAuthenticationStatement authnStat = null;

		try {
			authnStat = new SAMLAuthenticationStatement((SAMLSubject) subject
			        .clone(), authnMtd, new Date(), null, null, null);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		return authnStat;
	}

	/**
	 * Gets the signed assertion.
	 * 
	 * @param assertion
	 *            the assertion
	 * @param keyStoreFilename
	 *            the key store filename
	 * @param keyStoreType
	 *            the key store type
	 * @param certAlias
	 *            the cert alias
	 * @param certPswd
	 *            the cert pswd
	 * @param includeCertpath
	 *            the include certpath
	 * @param isResponse
	 *            the is response
	 * 
	 * @return the signed assertion
	 */
	private SAMLSignedObject getSignedAssertion(SAMLSignedObject assertion,
	        String keyStoreFilename, String keyStoreType, String certAlias,
	        String certPswd, boolean includeCertpath, boolean isResponse) {
		if (StringUtils.isEmpty(keyStoreFilename)) {
			throw new SecurityException(
			        "keyStoreFilename is either null or empty string");
		}

		if (StringUtils.isEmpty(keyStoreType)) {
			throw new SecurityException("keyStoreType is either null or empty");
		}

		if (StringUtils.isEmpty(certAlias)) {
			throw new SecurityException("certAlias is either null or empty");
		}

		if (StringUtils.isEmpty(certPswd)) {
			throw new SecurityException("certPswd is either null or empty");
		}

		FileInputStream fin = null;

		try {
			KeyStore store = KeyStore.getInstance(keyStoreType);
			ResourceLoader rs = new DefaultResourceLoader();
			ClassPathResource resource = (ClassPathResource) rs
			        .getResource(keyStoreFilename);
			fin = new FileInputStream(resource.getFile());
			store.load(fin, null);

			Key privateKey = store.getKey(certAlias, certPswd.toCharArray());

			if (privateKey != null) {
				List<Certificate> certs = new ArrayList<Certificate>();

				if (includeCertpath) {
					if (isResponse) {
						Certificate cert = store.getCertificate(certAlias);

						if (cert == null) {
							throw new SecurityException(
							        "unable to get certificate using certAlias");
						}

						certs.add(cert);
					}
					else {
						Certificate certArray[] = store
						        .getCertificateChain(certAlias);

						if (certArray == null) {
							throw new SecurityException(
							        "unable to get certificate chain using certAlias");
						}

						certs.addAll(Arrays.asList(certArray));
					}

					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, certs);
				}
				else {
					assertion.sign(XMLSignature.ALGO_ID_SIGNATURE_RSA,
					        privateKey, null);
				}
			}
			else {
				throw new SecurityException(
				        "private key was null and hence cannot sign assertion");
			}
		}
		catch (KeyStoreException e) {
			throw new RuntimeException(e);
		}
		catch (FileNotFoundException e) {
			throw new RuntimeException(e);
		}
		catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		}
		catch (CertificateException e) {
			throw new RuntimeException(e);
		}
		catch (UnrecoverableKeyException e) {
			throw new RuntimeException(e);
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
		catch (SAMLException e) {
			throw new RuntimeException(e);
		}
		finally {
			IOUtils.closeQuietly(fin);
		}

		return assertion;
	}

	/**
	 * Checks if is response type.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if is response type
	 */
	private boolean isResponseType(String credentialTypes) {
		boolean responseType = false;

		if (SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE_NO_CERTPATH.equals(credentialTypes)) {
			responseType = true;
		}

		return responseType;
	}

	/**
	 * Require certpath.
	 * 
	 * @param credentialTypes
	 *            the credential types
	 * 
	 * @return true, if successful
	 */
	private boolean requireCertpath(String credentialTypes) {
		boolean requireCertpath = false;

		if (SAML_ASSERTION_CERTPATH.equals(credentialTypes)
		        || SAML_RESPONSE.equals(credentialTypes)
		        || SAML_RESPONSE_CERTPATH.equals(credentialTypes)) {
			requireCertpath = true;
		}

		return requireCertpath;
	}

}
  
> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771911#action_12771911 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


> The SAML Assertion produced is not the same as the one I need, so I just need to figure out through the forums on how to Sign the Assertion, not the message itself.

Just to be clear, the assertion is getting signed, but the message body itself is also signed. I think with the current code you must sign the body or else explicitly specify something else to sign.

> The one I need is like this (so I also need to add a Conditions statement if possible): 

I'm not sure if this is currently supported. Let me know how you get on.

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768457#action_12768457 ] 

Jay Blanton commented on WSS-213:
---------------------------------

Here is a sample of a SAMLAssertion that I am attempting to create with OpenSAML:

wsse:Security
	xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
		xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		AssertionID="_a80c123457835405680ddddac4ee6abc" IssueInstant="2008-03-07T17:47:56.848Z"
		Issuer="www.foo.com/saml" MajorVersion="1" MinorVersion="1">
		<Conditions NotBefore="2008-03-07T17:46:16.770Z"
			NotOnOrAfter="2008-03-07T17:49:36.770Z" />
		<AuthenticationStatement
			AuthenticationInstant="2008-03-07T17:47:56.770Z"
			AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
			<Subject>
				<NameIdentifier>foo_service_user1</NameIdentifier>
				<SubjectConfirmation>
					<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches
					</ConfirmationMethod>
				</SubjectConfirmation>
			</Subject>
		</AuthenticationStatement>
		<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
			<ds:SignedInfo>
				<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
				<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
				<ds:Reference URI="#_a80c123457835405680ddddac4ee6abc">
					<ds:Transforms>
						<ds:Transform
							Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
						<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
							<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
								PrefixList="code ds kind rw saml samlp typens #default xsd xsi" />
						</ds:Transform>
					</ds:Transforms>
					<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
					<ds:DigestValue>0ywwQMasdff3can1eH+0kVdUyw4=</ds:DigestValue>
				</ds:Reference>
			</ds:SignedInfo>
			<ds:SignatureValue>
				uvp8ZMm234asdfaNE9cjhyOg55RH4asdfadsfdsBT6vM48eKkmWBIhXJrLH8MKQ5dVApKmBm
				ZKZhjDW2+8qrrsVDasdfadsfdsnoltuoh8MbCTTgiukAlkasdfdasfdstFdLL+Cj0hppJJ/N
				F9so+/1ohJciQ99KfOg= </ds:SignatureValue>
		</ds:Signature>
	</Assertion>
</wsse:Security>

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Updated: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jay Blanton updated WSS-213:
----------------------------

    Attachment: wss4j.saml-jks.tar.gz

Okay, so the information you gave me about JCE helped me.

I was able to run the TestWSSecurityNewST2.java example with OpenJDK an Sun's JDK (where before I was getting a NPE).  Thanks!!!

The next step I did was then take that example which does a SAML Signed Sender Voucher and switch the key type to use a jks keystore, which is what is at the core of my problem.  So I introduced my companies keystore and information, but I get the "General security certificate error again".

So what I did is follow the same steps to create a new test keystore and cer file using the following commands.

keytool -genkey -alias fooprod -keyalg RSA -dname "CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US" -validity 3650 -keystore fooidprod.jks -storepass password -keypass password

keytool -export -alias fooprod -file fooprod.cer -keystore fooidprod.jks -storepass password

I then used the project attached to this ticket and added the jks and cer files includng the information necessary in the properties files.  I also included a sample SAML Assertion (not valid because I mixed some of the information), but its a valid format for what we currently produce using OpenSAML.

It does appear that the following fields (int the properties files saml/crypto) are not relevant to the keystore creation and seem to be based more on the endpoint PEP (I guess):
org.apache.ws.security.saml.issuer.key.name=sample_foo
org.apache.ws.security.saml.issuer=www.foo.com/saml
org.apache.ws.security.saml.subjectNameId.qualifier=www.foo.com/saml

I have the console display below where I verify the keystore, and then I run "mvn clean package" that produces the errors".

Is there an actual issue or am I providing the wrong information in the properties files.

If I can fix this, then I can fix my custom interceptor for Spring Web Services, and then I can suggest an enhancement to Spring Web Services to expose the WSS4J support of SAML Tokens.

I really really appreciate your time and insight into this.

Thanks...jay

a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ cd src/test/resources/
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ keytool -list -v -keystore fooidprod.jks -alias fooprod
Enter keystore password:  
Alias name: fooprod
Creation date: Oct 23, 2009
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Issuer: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Serial number: 4ae20406
Valid from: Fri Oct 23 12:29:10 PDT 2009 until: Mon Oct 21 12:29:10 PDT 2019
Certificate fingerprints:
	 MD5:  29:AF:0F:DA:63:69:96:84:A3:CF:1B:D7:8A:F8:7A:CA
	 SHA1: 8E:2C:29:8B:79:64:79:F0:9D:4D:81:F5:65:51:5C:B8:D9:E3:8D:AB
	 Signature algorithm name: SHA1withRSA
	 Version: 3
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ cd ../../../
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ mvn clean package[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Saml Sample Client
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target
[INFO] Preparing pmd:check
[INFO] [pmd:pmd]
[INFO] [pmd:check {execution: validate}]
[INFO] 
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] inceptionYear not specified, defaulting to 2009
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running wssec.PackageTests
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 5.512 sec <<< FAILURE!
testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 2.918 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:146)

testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:189)

testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.017 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:234)

testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:276)


Results :

Tests in error: 
  testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
  testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
  testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
  testWSS62(wssec.TestWSSecurityNewST2)

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23 seconds
[INFO] Finished at: Fri Oct 23 12:44:19 PDT 2009
[INFO] Final Memory: 18M/32M
[INFO] ------------------------------------------------------------------------
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ 


> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Issue Comment Edited: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769388#action_12769388 ] 

Jay Blanton edited comment on WSS-213 at 10/23/09 7:54 PM:
-----------------------------------------------------------

I just attached (wss4j.saml-jks.tar.gz) to this response.

Okay, so the information you gave me about JCE helped me.

I was able to run the TestWSSecurityNewST2.java example with OpenJDK an Sun's JDK (where before I was getting a NPE).  Thanks!!!

The next step I did was then take that example which does a SAML Signed Sender Voucher and switch the key type to use a jks keystore, which is what is at the core of my problem.  So I introduced my companies keystore and information, but I get the "General security certificate error again".

So what I did is follow the same steps to create a new test keystore and cer file using the following commands.

keytool -genkey -alias fooprod -keyalg RSA -dname "CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US" -validity 3650 -keystore fooidprod.jks -storepass password -keypass password

keytool -export -alias fooprod -file fooprod.cer -keystore fooidprod.jks -storepass password

I then used the project attached to this ticket and added the jks and cer files includng the information necessary in the properties files.  I also included a sample SAML Assertion (not valid because I mixed some of the information), but its a valid format for what we currently produce using OpenSAML.

It does appear that the following fields (int the properties files saml/crypto) are not relevant to the keystore creation and seem to be based more on the endpoint PEP (I guess):
org.apache.ws.security.saml.issuer.key.name=sample_foo
org.apache.ws.security.saml.issuer=www.foo.com/saml
org.apache.ws.security.saml.subjectNameId.qualifier=www.foo.com/saml

I have the console display below where I verify the keystore, and then I run "mvn clean package" that produces the errors".

Is there an actual issue or am I providing the wrong information in the properties files.

If I can fix this, then I can fix my custom interceptor for Spring Web Services, and then I can suggest an enhancement to Spring Web Services to expose the WSS4J support of SAML Tokens.

I really really appreciate your time and insight into this.

Thanks...jay

a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ cd src/test/resources/
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ keytool -list -v -keystore fooidprod.jks -alias fooprod
Enter keystore password:  
Alias name: fooprod
Creation date: Oct 23, 2009
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Issuer: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Serial number: 4ae20406
Valid from: Fri Oct 23 12:29:10 PDT 2009 until: Mon Oct 21 12:29:10 PDT 2019
Certificate fingerprints:
	 MD5:  29:AF:0F:DA:63:69:96:84:A3:CF:1B:D7:8A:F8:7A:CA
	 SHA1: 8E:2C:29:8B:79:64:79:F0:9D:4D:81:F5:65:51:5C:B8:D9:E3:8D:AB
	 Signature algorithm name: SHA1withRSA
	 Version: 3
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ cd ../../../
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ mvn clean package[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Saml Sample Client
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target
[INFO] Preparing pmd:check
[INFO] [pmd:pmd]
[INFO] [pmd:check {execution: validate}]
[INFO] 
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] inceptionYear not specified, defaulting to 2009
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running wssec.PackageTests
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 5.512 sec <<< FAILURE!
testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 2.918 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:146)

testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:189)

testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.017 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:234)

testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:276)


Results :

Tests in error: 
  testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
  testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
  testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
  testWSS62(wssec.TestWSSecurityNewST2)

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23 seconds
[INFO] Finished at: Fri Oct 23 12:44:19 PDT 2009
[INFO] Final Memory: 18M/32M
[INFO] ------------------------------------------------------------------------
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ 


      was (Author: jaybytez):
    Okay, so the information you gave me about JCE helped me.

I was able to run the TestWSSecurityNewST2.java example with OpenJDK an Sun's JDK (where before I was getting a NPE).  Thanks!!!

The next step I did was then take that example which does a SAML Signed Sender Voucher and switch the key type to use a jks keystore, which is what is at the core of my problem.  So I introduced my companies keystore and information, but I get the "General security certificate error again".

So what I did is follow the same steps to create a new test keystore and cer file using the following commands.

keytool -genkey -alias fooprod -keyalg RSA -dname "CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US" -validity 3650 -keystore fooidprod.jks -storepass password -keypass password

keytool -export -alias fooprod -file fooprod.cer -keystore fooidprod.jks -storepass password

I then used the project attached to this ticket and added the jks and cer files includng the information necessary in the properties files.  I also included a sample SAML Assertion (not valid because I mixed some of the information), but its a valid format for what we currently produce using OpenSAML.

It does appear that the following fields (int the properties files saml/crypto) are not relevant to the keystore creation and seem to be based more on the endpoint PEP (I guess):
org.apache.ws.security.saml.issuer.key.name=sample_foo
org.apache.ws.security.saml.issuer=www.foo.com/saml
org.apache.ws.security.saml.subjectNameId.qualifier=www.foo.com/saml

I have the console display below where I verify the keystore, and then I run "mvn clean package" that produces the errors".

Is there an actual issue or am I providing the wrong information in the properties files.

If I can fix this, then I can fix my custom interceptor for Spring Web Services, and then I can suggest an enhancement to Spring Web Services to expose the WSS4J support of SAML Tokens.

I really really appreciate your time and insight into this.

Thanks...jay

a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ cd src/test/resources/
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ keytool -list -v -keystore fooidprod.jks -alias fooprod
Enter keystore password:  
Alias name: fooprod
Creation date: Oct 23, 2009
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Issuer: CN=fooprod, OU=cto, O=Foo Inc, L=Sacramento, ST=CA, C=US
Serial number: 4ae20406
Valid from: Fri Oct 23 12:29:10 PDT 2009 until: Mon Oct 21 12:29:10 PDT 2019
Certificate fingerprints:
	 MD5:  29:AF:0F:DA:63:69:96:84:A3:CF:1B:D7:8A:F8:7A:CA
	 SHA1: 8E:2C:29:8B:79:64:79:F0:9D:4D:81:F5:65:51:5C:B8:D9:E3:8D:AB
	 Signature algorithm name: SHA1withRSA
	 Version: 3
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/src/test/resources$ cd ../../../
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ mvn clean package[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Saml Sample Client
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target
[INFO] Preparing pmd:check
[INFO] [pmd:pmd]
[INFO] [pmd:check {execution: validate}]
[INFO] 
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] inceptionYear not specified, defaulting to 2009
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running wssec.PackageTests
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
- Before SAMLSignedSenderVouches....
- Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 5.512 sec <<< FAILURE!
testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 2.918 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:146)

testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:189)

testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.017 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:234)

testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.008 sec  <<< ERROR!
org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
	at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
	at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:276)


Results :

Tests in error: 
  testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
  testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
  testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
  testWSS62(wssec.TestWSSecurityNewST2)

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

Please refer to /home/a068071/Public/Development/eclipse3.5-workspace/wss4j.saml-jks/target/surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23 seconds
[INFO] Finished at: Fri Oct 23 12:44:19 PDT 2009
[INFO] Final Memory: 18M/32M
[INFO] ------------------------------------------------------------------------
a068071@a068071-desktop:~/Public/Development/eclipse3.5-workspace/wss4j.saml-jks$ 

  
> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773584#action_12773584 ] 

Jay Blanton commented on WSS-213:
---------------------------------

Colm,

How would I find out what types of SAML Assertions can be created and controlled through the properties files like (saml and crypto) as opposed to using the API directly?

I am trying to understand through this whether a specific type of SAML Token is created when saml and crypto properties are used.

And it sounds like the type of SAML Token that I want to create is not possible this way (since I want to create an Assertion and then Digitally Sign just the assertion), so I must always use the API directly.

Does this sound correctly?

Thanks,

Jay Blanton

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770473#action_12770473 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


You need to change three things:

1) Change the saml issuer key name in saml.properties to be "fooprod".
2) Change the password that's set by the callback handler in TestWSSecurityNewST2 from "security" to "password".
3) Change the keystore filename property in crypto.properties to "org.apache.ws.security.crypto.merlin.file" from "org.apache.ws.security.crypto.merlin.keystore.file".

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Closed: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh closed WSS-213.
-----------------------------------


> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774952#action_12774952 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


> How would I find out what types of SAML Assertions can be created and controlled through the properties files like (saml and crypto) as opposed to using the API directly?

Probably the best way is to look at the source:

http://ws.apache.org/wss4j/xref/org/apache/ws/security/saml/SAMLIssuerFactory.html
http://ws.apache.org/wss4j/xref/org/apache/ws/security/saml/SAMLIssuerImpl.html

> And it sounds like the type of SAML Token that I want to create is not possible this way

Yes, the range of SAML assertions that can be generated through the properties file is quite limited.

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857309#action_12857309 ] 

Colm O hEigeartaigh commented on WSS-213:
-----------------------------------------


Can this issue be marked as won't-fix? The reported problem has been resolved.

Colm.

> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Issue Comment Edited: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768457#action_12768457 ] 

Jay Blanton edited comment on WSS-213 at 10/21/09 9:03 PM:
-----------------------------------------------------------

Here is a sample of a SAMLAssertion that I am attempting to create with OpenSAML:

<wsse:Security
	xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
		xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		AssertionID="_a80c123457835405680ddddac4ee6abc" IssueInstant="2008-03-07T17:47:56.848Z"
		Issuer="www.foo.com/saml" MajorVersion="1" MinorVersion="1">
		<Conditions NotBefore="2008-03-07T17:46:16.770Z"
			NotOnOrAfter="2008-03-07T17:49:36.770Z" />
		<AuthenticationStatement
			AuthenticationInstant="2008-03-07T17:47:56.770Z"
			AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
			<Subject>
				<NameIdentifier>foo_service_user1</NameIdentifier>
				<SubjectConfirmation>
					<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches
					</ConfirmationMethod>
				</SubjectConfirmation>
			</Subject>
		</AuthenticationStatement>
		<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
			<ds:SignedInfo>
				<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
				<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
				<ds:Reference URI="#_a80c123457835405680ddddac4ee6abc">
					<ds:Transforms>
						<ds:Transform
							Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
						<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
							<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
								PrefixList="code ds kind rw saml samlp typens #default xsd xsi" />
						</ds:Transform>
					</ds:Transforms>
					<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
					<ds:DigestValue>0ywwQMasdff3can1eH+0kVdUyw4=</ds:DigestValue>
				</ds:Reference>
			</ds:SignedInfo>
			<ds:SignatureValue>
				uvp8ZMm234asdfaNE9cjhyOg55RH4asdfadsfdsBT6vM48eKkmWBIhXJrLH8MKQ5dVApKmBm
				ZKZhjDW2+8qrrsVDasdfadsfdsnoltuoh8MbCTTgiukAlkasdfdasfdstFdLL+Cj0hppJJ/N
				F9so+/1ohJciQ99KfOg= </ds:SignatureValue>
		</ds:Signature>
	</Assertion>
</wsse:Security>

      was (Author: jaybytez):
    Here is a sample of a SAMLAssertion that I am attempting to create with OpenSAML:

wsse:Security
	xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
		xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		AssertionID="_a80c123457835405680ddddac4ee6abc" IssueInstant="2008-03-07T17:47:56.848Z"
		Issuer="www.foo.com/saml" MajorVersion="1" MinorVersion="1">
		<Conditions NotBefore="2008-03-07T17:46:16.770Z"
			NotOnOrAfter="2008-03-07T17:49:36.770Z" />
		<AuthenticationStatement
			AuthenticationInstant="2008-03-07T17:47:56.770Z"
			AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
			<Subject>
				<NameIdentifier>foo_service_user1</NameIdentifier>
				<SubjectConfirmation>
					<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches
					</ConfirmationMethod>
				</SubjectConfirmation>
			</Subject>
		</AuthenticationStatement>
		<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
			<ds:SignedInfo>
				<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
				<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
				<ds:Reference URI="#_a80c123457835405680ddddac4ee6abc">
					<ds:Transforms>
						<ds:Transform
							Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
						<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
							<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
								PrefixList="code ds kind rw saml samlp typens #default xsd xsi" />
						</ds:Transform>
					</ds:Transforms>
					<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
					<ds:DigestValue>0ywwQMasdff3can1eH+0kVdUyw4=</ds:DigestValue>
				</ds:Reference>
			</ds:SignedInfo>
			<ds:SignatureValue>
				uvp8ZMm234asdfaNE9cjhyOg55RH4asdfadsfdsBT6vM48eKkmWBIhXJrLH8MKQ5dVApKmBm
				ZKZhjDW2+8qrrsVDasdfadsfdsnoltuoh8MbCTTgiukAlkasdfdasfdstFdLL+Cj0hppJJ/N
				F9so+/1ohJciQ99KfOg= </ds:SignatureValue>
		</ds:Signature>
	</Assertion>
</wsse:Security>
  
> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


[jira] Commented: (WSS-213) Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)

Posted by "Jay Blanton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSS-213?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771600#action_12771600 ] 

Jay Blanton commented on WSS-213:
---------------------------------

Thank you very much Colm.  I probably can close this bug now because I got it working after I followed your suggestions.  I was able to successfully build a SAML Assertion without getting the General security error.

The SAML Assertion produced is not the same as the one I need, so I just need to figure out through the forums on how to Sign the Assertion, not the message itself.

The one I need is like this (so I also need to add a Conditions statement if possible):

<wsse:Security
	xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
	<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion"
		xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		AssertionID="_a80ca890be635405680be55ac4ee6d93" IssueInstant="2008-03-07T17:47:56.848Z"
		Issuer="www.foo.com/saml" MajorVersion="1" MinorVersion="1">
		<Conditions NotBefore="2008-03-07T17:46:16.770Z"
			NotOnOrAfter="2008-03-07T17:49:36.770Z" />
		<AuthenticationStatement
			AuthenticationInstant="2008-03-07T17:47:56.770Z"
			AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
			<Subject>
				<NameIdentifier>sample_foo</NameIdentifier>
				<SubjectConfirmation>
					<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches
					</ConfirmationMethod>
				</SubjectConfirmation>
			</Subject>
		</AuthenticationStatement>
		<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
			<ds:SignedInfo>
				<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
				<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
				<ds:Reference URI="#_a80ca890be635405680be55ac4ee6d93">
					<ds:Transforms>
						<ds:Transform
							Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
						<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
							<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
								PrefixList="code ds kind rw saml samlp typens #default xsd xsi" />
						</ds:Transform>
					</ds:Transforms>
					<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
					<ds:DigestValue>0ywwQM3nARW323423423H+0kVdUyw4=</ds:DigestValue>
				</ds:Reference>
			</ds:SignedInfo>
			<ds:SignatureValue>
				asdjdsjsakhfk2324h234kj2hkh23kkjj2hkhitwScJBT6vM48eKkmWBIhXJrLH8MKQ5dVApKmBm
				ZKZhjDW2+8qrrsVDWHXLt7zEFrwmLasdfsadf8MbCTTgiukAlkygwpJeC2W7tFdLL+Cj0hppJJ/N
				F9so+/1ohJciQ99KfOg= </ds:SignatureValue>
		</ds:Signature>
	</Assertion>
</wsse:Security>

The one that was generated looks like this:
		<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
			SOAP-ENV:mustUnderstand="1">
			<Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
				xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" AssertionID="_841476b57b62a33f09e713cb5b00227a" IssueInstant="2009-10-29T20:39:17.458Z"
				Issuer="www.foo.com/saml" MajorVersion="1" MinorVersion="1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
				<AuthenticationStatement AuthenticationInstant="2009-10-29T20:39:17.448Z"
					AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password">
					<Subject>
						<NameIdentifier>sample_foo</NameIdentifier>
						<SubjectConfirmation>
							<ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</ConfirmationMethod>
						</SubjectConfirmation>
					</Subject>
				</AuthenticationStatement>
			</Assertion>
			<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
				wsu:Id="STRSAMLId-813BCA6C616ADD2FD112568487575664" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
				<wsse:Reference URI="#_841476b57b62a33f09e713cb5b00227a" ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID"
					xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
			</wsse:SecurityTokenReference>
			<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
				EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
				ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="CertId-813BCA6C616ADD2FD112568487575663"
				xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">MIICOTCCAaKgAwIBAgIESuIEBjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNVBAcTClNhY3JhbWVudG8xEDAOBgNVBAoTB0ZvbyBJbmMxDDAKBgNVBAsTA2N0bzEQMA4GA1UEAxMHZm9vcHJvZDAeFw0wOTEwMjMxOTI5MTBaFw0xOTEwMjExOTI5MTBaMGExCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTETMBEGA1UEBxMKU2FjcmFtZW50bzEQMA4GA1UEChMHRm9vIEluYzEMMAoGA1UECxMDY3RvMRAwDgYDVQQDEwdmb29wcm9kMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSqSJmuu16jhF/Wro/bkaSo+eqqCRxwfcH8VkeOVHgmyHK3DH6hav43FepNgR1pnOxiu7oHEVIGqLgFU5T1Lb82Y7DNfnmNQfRswGf900k687wm14H73uJe5XNg+craDR2cv5POV6sqCU+WTLmykKs3X89CXWKxpGGYnFS2SnsqQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAF/HmyXcKgqqFke15C2fTRzPV+OZ2Txe/QvNaQ7PrYk3uk3K9gIgT773cBsdYPepEN1WCzALWew9HBEJyunCYcSi6wY3EqDXdXjsDG3ZNXzWcv88x8gHgoKpws+1xQ5FCOXgc0EUISeX2g+QIlnbrC926e6pDro0nnx3zCEeUzqa
			</wsse:BinarySecurityToken>
			<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-1">
				<ds:SignedInfo>
					<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
					<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
					<ds:Reference URI="#STRSAMLId-813BCA6C616ADD2FD112568487575664">
						<ds:Transforms>
							<ds:Transform Algorithm="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#STR-Transform">
								<wsse:TransformationParameters
									xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
									<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"
										xmlns:ds="http://www.w3.org/2000/09/xmldsig#" />
								</wsse:TransformationParameters>
							</ds:Transform>
						</ds:Transforms>
						<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
						<ds:DigestValue>ueNtY5s89fxfAWxuZr1L79j5W68=</ds:DigestValue>
					</ds:Reference>
					<ds:Reference URI="#id-2">
						<ds:Transforms>
							<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
						</ds:Transforms>
						<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
						<ds:DigestValue>cFoMux4UEiqzRSXPHWwTO/v62jk=</ds:DigestValue>
					</ds:Reference>
				</ds:SignedInfo>
				<ds:SignatureValue>
					Q8mjQXS0ddrfbOVY0DmbHCjfQ2ZM0yT1T1Ryw1uIyAe7opp4SrjU/gV57YnyCaurxj8npdocEjBm
					kDcMfhqV7V1l1oXFfTgPPb/MTUhTDdvR0Trx0M04+Ntlh5FR+HFXtGj2vZpE091o6f6KDOGfbALQ
					ppBQTKIlt13FSQPSPHU=
</ds:SignatureValue>
				<ds:KeyInfo Id="KeyId-813BCA6C616ADD2FD112568487575641" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
					<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
						wsu:Id="STRId-813BCA6C616ADD2FD112568487575662" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
						<wsse:Reference URI="#CertId-813BCA6C616ADD2FD112568487575663"
							ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
					</wsse:SecurityTokenReference>
				</ds:KeyInfo>
			</ds:Signature>
		</wsse:Security>

Thank you so much for your help!....jay


> Running TestWSSecurityNewST2 Fails - General security error (No certificates were found for SAML signature)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-213
>                 URL: https://issues.apache.org/jira/browse/WSS-213
>             Project: WSS4J
>          Issue Type: Bug
>    Affects Versions: 1.5.8
>         Environment: OS = Ubuntu 9.04
> Eclipse = JEE Eclipse, Galileo, STS, m2eclipse
> JDK = java-6-sun-1.6.0.16, java-1.5.0-sun-1.5.0.19 (attempted as well)
>            Reporter: Jay Blanton
>            Assignee: Ruchith Udayanga Fernando
>            Priority: Critical
>         Attachments: wss4j.saml-jks.tar.gz, wss4j.saml.tar.gz
>
>
> I pulled down the 1.5.8, 1.5.8-SNAPSHOT, and pulled down the trunk for 1.6.
> I tried to build the trunk by doing a mvn package -Dmaven.test.skip=true (because quite a few unit tests fail).
> Then I try to run TestWSSecurityNewST2 and it fails.
> This is the exact issue I am having when trying to get my Spring Web Service Implementation to work with WSS4J's SAML Support (which it appears that Spring does not expose so I have to create a custom Interceptor).
> I have working examples of a digital signature, encryption, and UsernameToken with Spring Web Services support for SAML, but the SAML is not working.  So I specifically went to the WSS4J examples to see if I could get those working first, and then working with my keystores, but the default test does not work for me that shipped with WSS4J.
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Ping Web Service Client
> [INFO]
> [INFO] Id: com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> [INFO] task-segment: [package]
> [INFO] ------------------------------------------------------------------------
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:compile]
> [INFO] Compiling 10 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [jibx:bind]
> [INFO] Not running JiBX binding compiler (single-module mode) - no binding files
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [compiler:testCompile]
> [INFO] Compiling 4 source files to /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/test-classes
> url = http://repo1.maven.org/maven2
> Downloading: http://repo1.maven.org/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://static.appfuse.org/repository
> Downloading: http://static.appfuse.org/repository/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> url = http://repository.jboss.com/maven2
> Downloading: http://repository.jboss.com/maven2/com/sun/xml/wss/xws-security/2.0-FCS/xws-security-2.0-FCS.pom
> [INFO] [surefire:test]
> [INFO] Surefire report directory: /home/a068071/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running wssec.TestWSSecurityNewST2
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml3.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> INFO [wssec.TestWSSecurityNewST2] Before SAMLSignedSenderVouches....
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> DEBUG [security.util.Loader] Trying to find [saml.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> INFO [security.saml.SAMLIssuerFactory] Using Crypto Engine [org.apache.ws.security.saml.SAMLIssuerImpl]
> DEBUG [security.util.Loader] Trying to find [crypto.properties] using sun.misc.Launcher$AppClassLoader@133056f class loader.
> DEBUG [components.crypto.CryptoFactory] Using Crypto Engine [org.apache.ws.security.components.crypto.Merlin]
> DEBUG [components.crypto.AbstractCrypto] CA certs have been loaded
> DEBUG [security.saml.SAMLIssuerImpl] Begin add SAMLAssertion token...
> DEBUG [security.saml.WSSecSignatureSAML] Beginning ST signing...
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.222 sec <<< FAILURE!
> Results :
> Tests in error:
>   testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)
>   testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)
>   testDefaultIssuerClass(wssec.TestWSSecurityNewST2)
>   testWSS62(wssec.TestWSSecurityNewST2)
> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
> [ERROR]
> Mojo:
>     org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> FAILED for project:
>     com.foo:ping.ws-saml:jar:0.0.1-SNAPSHOT
> Reason:
> There are test failures.
> Please refer to /home/jay/Public/Development/eclipse3.5-workspace/ping.ws-saml/target/surefire-reports for the individual test results.
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run with the -e flag
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILED
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 16 seconds
> [INFO] Finished at: Wed Oct 07 13:29:03 PDT 2009
> [INFO] Final Memory: 4M/25M
> [INFO] ------------------------------------------------------------------------
> Here is the errors from the test report:
> -------------------------------------------------------------------------------
> Test set: wssec.TestWSSecurityNewST2
> -------------------------------------------------------------------------------
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.731 sec <<< FAILURE!
> testSAMLSignedSenderVouches(wssec.TestWSSecurityNewST2)  Time elapsed: 0.486 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouches(TestWSSecurityNewST2.java:114)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testSAMLSignedSenderVouchesKeyIdentifier(wssec.TestWSSecurityNewST2)  Time elapsed: 0.064 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testSAMLSignedSenderVouchesKeyIdentifier(TestWSSecurityNewST2.java:156)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testDefaultIssuerClass(wssec.TestWSSecurityNewST2)  Time elapsed: 0.156 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testDefaultIssuerClass(TestWSSecurityNewST2.java:200)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> testWSS62(wssec.TestWSSecurityNewST2)  Time elapsed: 0.011 sec  <<< ERROR!
> org.apache.ws.security.WSSecurityException: General security error (No certificates were found for SAML signature)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.prepare(WSSecSignatureSAML.java:276)
>         at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:110)
>         at wssec.TestWSSecurityNewST2.testWSS62(TestWSSecurityNewST2.java:241)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:168)
>         at junit.framework.TestCase.runBare(TestCase.java:134)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org