You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by gi...@apache.org on 2013/04/01 15:27:47 UTC
svn commit: r1463132 [3/4] - in /santuario/xml-security-java/trunk/src:
main/java/org/apache/xml/security/stax/ext/
main/java/org/apache/xml/security/stax/impl/
main/java/org/apache/xml/security/stax/impl/processor/input/
main/java/org/apache/xml/secur...
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509IssuerSerialSecurityToken.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509IssuerSerialSecurityToken.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509IssuerSerialSecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509IssuerSerialSecurityToken.java Mon Apr 1 13:27:45 2013
@@ -18,8 +18,8 @@
*/
package org.apache.xml.security.stax.impl.securityToken;
-import org.apache.xml.security.stax.ext.SecurityContext;
-import org.apache.xml.security.stax.ext.XMLSecurityConstants;
+import org.apache.xml.security.stax.ext.InboundSecurityContext;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
import java.math.BigInteger;
@@ -31,9 +31,9 @@ public class X509IssuerSerialSecurityTok
private String issuerName;
private BigInteger serialNumber;
- protected X509IssuerSerialSecurityToken(XMLSecurityConstants.TokenType tokenType, SecurityContext securityContext,
- String id, XMLSecurityConstants.KeyIdentifierType keyIdentifierType) {
- super(tokenType, securityContext, id, keyIdentifierType);
+ protected X509IssuerSerialSecurityToken(SecurityTokenConstants.TokenType tokenType, InboundSecurityContext inboundSecurityContext,
+ String id, SecurityTokenConstants.KeyIdentifier keyIdentifier) {
+ super(tokenType, inboundSecurityContext, id, keyIdentifier);
}
public String getIssuerName() {
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SKISecurityToken.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SKISecurityToken.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SKISecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SKISecurityToken.java Mon Apr 1 13:27:45 2013
@@ -18,8 +18,8 @@
*/
package org.apache.xml.security.stax.impl.securityToken;
-import org.apache.xml.security.stax.ext.SecurityContext;
-import org.apache.xml.security.stax.ext.XMLSecurityConstants;
+import org.apache.xml.security.stax.ext.InboundSecurityContext;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
/**
* @author $Author: coheigea $
@@ -29,9 +29,9 @@ public class X509SKISecurityToken extend
private byte[] skiBytes;
- protected X509SKISecurityToken(XMLSecurityConstants.TokenType tokenType, SecurityContext securityContext, String id,
- XMLSecurityConstants.KeyIdentifierType keyIdentifierType) {
- super(tokenType, securityContext, id, keyIdentifierType);
+ protected X509SKISecurityToken(SecurityTokenConstants.TokenType tokenType, InboundSecurityContext inboundSecurityContext, String id,
+ SecurityTokenConstants.KeyIdentifier keyIdentifier) {
+ super(tokenType, inboundSecurityContext, id, keyIdentifier);
}
public byte[] getSkiBytes() {
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SecurityToken.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SecurityToken.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SecurityToken.java Mon Apr 1 13:27:45 2013
@@ -19,8 +19,8 @@
package org.apache.xml.security.stax.impl.securityToken;
import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.stax.ext.SecurityContext;
-import org.apache.xml.security.stax.ext.XMLSecurityConstants;
+import org.apache.xml.security.stax.ext.InboundSecurityContext;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
/**
* @author $Author: coheigea $
@@ -28,11 +28,11 @@ import org.apache.xml.security.stax.ext.
*/
public class X509SecurityToken extends AbstractInboundSecurityToken {
- private final XMLSecurityConstants.TokenType tokenType;
+ private final SecurityTokenConstants.TokenType tokenType;
- protected X509SecurityToken(XMLSecurityConstants.TokenType tokenType, SecurityContext securityContext,
- String id, XMLSecurityConstants.KeyIdentifierType keyIdentifierType) {
- super(securityContext, id, keyIdentifierType);
+ protected X509SecurityToken(SecurityTokenConstants.TokenType tokenType, InboundSecurityContext inboundSecurityContext,
+ String id, SecurityTokenConstants.KeyIdentifier keyIdentifier) {
+ super(inboundSecurityContext, id, keyIdentifier);
this.tokenType = tokenType;
}
@@ -42,7 +42,7 @@ public class X509SecurityToken extends A
}
@Override
- public XMLSecurityConstants.TokenType getTokenType() {
+ public SecurityTokenConstants.TokenType getTokenType() {
return tokenType;
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SubjectNameSecurityToken.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SubjectNameSecurityToken.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SubjectNameSecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/X509SubjectNameSecurityToken.java Mon Apr 1 13:27:45 2013
@@ -18,8 +18,8 @@
*/
package org.apache.xml.security.stax.impl.securityToken;
-import org.apache.xml.security.stax.ext.SecurityContext;
-import org.apache.xml.security.stax.ext.XMLSecurityConstants;
+import org.apache.xml.security.stax.ext.InboundSecurityContext;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
/**
* @author $Author: coheigea $
@@ -29,9 +29,9 @@ public class X509SubjectNameSecurityToke
private String subjectName;
- protected X509SubjectNameSecurityToken(XMLSecurityConstants.TokenType tokenType, SecurityContext securityContext,
- String id, XMLSecurityConstants.KeyIdentifierType keyIdentifierType) {
- super(tokenType, securityContext, id, keyIdentifierType);
+ protected X509SubjectNameSecurityToken(SecurityTokenConstants.TokenType tokenType, InboundSecurityContext inboundSecurityContext,
+ String id, SecurityTokenConstants.KeyIdentifier keyIdentifier) {
+ super(tokenType, inboundSecurityContext, id, keyIdentifier);
}
public String getSubjectName() {
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AbstractSecuredElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AbstractSecuredElementSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AbstractSecuredElementSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AbstractSecuredElementSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,8 +18,9 @@
*/
package org.apache.xml.security.stax.securityEvent;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
import java.util.List;
@@ -34,11 +35,15 @@ public abstract class AbstractSecuredEle
private SecurityToken securityToken;
private List<XMLSecurityConstants.ContentType> protectionOrder;
- public AbstractSecuredElementSecurityEvent(SecurityEventConstants.Event securityEventType, SecurityToken securityToken, List<XMLSecurityConstants.ContentType> protectionOrder) {
+ public AbstractSecuredElementSecurityEvent(
+ SecurityEventConstants.Event securityEventType, SecurityToken securityToken,
+ List<XMLSecurityConstants.ContentType> protectionOrder) {
this(securityEventType, securityToken, protectionOrder, false, false);
}
- public AbstractSecuredElementSecurityEvent(SecurityEventConstants.Event securityEventType, SecurityToken securityToken, List<XMLSecurityConstants.ContentType> protectionOrder, boolean signed, boolean encrypted) {
+ public AbstractSecuredElementSecurityEvent(
+ SecurityEventConstants.Event securityEventType, SecurityToken securityToken,
+ List<XMLSecurityConstants.ContentType> protectionOrder, boolean signed, boolean encrypted) {
super(securityEventType);
this.securityToken = securityToken;
this.protectionOrder = protectionOrder;
@@ -50,7 +55,7 @@ public abstract class AbstractSecuredEle
return securityToken;
}
- public void setSecurityToken(SecurityToken securityToken) {
+ public void setSecurityToken(InboundSecurityToken securityToken) {
this.securityToken = securityToken;
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AlgorithmSuiteSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AlgorithmSuiteSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AlgorithmSuiteSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/AlgorithmSuiteSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -32,7 +32,7 @@ public class AlgorithmSuiteSecurityEvent
private int keyLength;
private String algorithmURI;
- private XMLSecurityConstants.KeyUsage keyUsage;
+ private XMLSecurityConstants.AlgorithmUsage algorithmUsage;
public AlgorithmSuiteSecurityEvent() {
super(SecurityEventConstants.AlgorithmSuite);
@@ -54,11 +54,11 @@ public class AlgorithmSuiteSecurityEvent
this.algorithmURI = algorithmURI;
}
- public XMLSecurityConstants.KeyUsage getKeyUsage() {
- return keyUsage;
+ public XMLSecurityConstants.AlgorithmUsage getAlgorithmUsage() {
+ return algorithmUsage;
}
- public void setKeyUsage(XMLSecurityConstants.KeyUsage keyUsage) {
- this.keyUsage = keyUsage;
+ public void setAlgorithmUsage(XMLSecurityConstants.AlgorithmUsage algorithmUsage) {
+ this.algorithmUsage = algorithmUsage;
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/ContentEncryptedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/ContentEncryptedElementSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/ContentEncryptedElementSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/ContentEncryptedElementSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,7 +18,7 @@
*/
package org.apache.xml.security.stax.securityEvent;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import java.util.List;
@@ -29,7 +29,9 @@ import java.util.List;
*/
public class ContentEncryptedElementSecurityEvent extends AbstractSecuredElementSecurityEvent {
- public ContentEncryptedElementSecurityEvent(SecurityToken securityToken, boolean encrypted, List<XMLSecurityConstants.ContentType> protectionOrder) {
- super(SecurityEventConstants.ContentEncrypted, securityToken, protectionOrder, false, encrypted);
+ public ContentEncryptedElementSecurityEvent(
+ InboundSecurityToken inboundSecurityToken, boolean encrypted,
+ List<XMLSecurityConstants.ContentType> protectionOrder) {
+ super(SecurityEventConstants.ContentEncrypted, inboundSecurityToken, protectionOrder, false, encrypted);
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/DefaultTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/DefaultTokenSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/DefaultTokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/DefaultTokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,11 +18,13 @@
*/
package org.apache.xml.security.stax.securityEvent;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
+
/**
* @author $Author: giger $
* @version $Revision: 1228829 $ $Date: 2012-01-08 11:44:13 +0000 (Sun, 08 Jan 2012) $
*/
-public class DefaultTokenSecurityEvent extends TokenSecurityEvent {
+public class DefaultTokenSecurityEvent extends TokenSecurityEvent<SecurityToken> {
public DefaultTokenSecurityEvent() {
super(SecurityEventConstants.DefaultToken);
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedElementSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedElementSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedElementSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,7 +18,7 @@
*/
package org.apache.xml.security.stax.securityEvent;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import java.util.List;
@@ -29,7 +29,9 @@ import java.util.List;
*/
public class EncryptedElementSecurityEvent extends AbstractSecuredElementSecurityEvent {
- public EncryptedElementSecurityEvent(SecurityToken securityToken, boolean encrypted, List<XMLSecurityConstants.ContentType> protectionOrder) {
- super(SecurityEventConstants.EncryptedElement, securityToken, protectionOrder, false, encrypted);
+ public EncryptedElementSecurityEvent(
+ InboundSecurityToken inboundSecurityToken, boolean encrypted,
+ List<XMLSecurityConstants.ContentType> protectionOrder) {
+ super(SecurityEventConstants.EncryptedElement, inboundSecurityToken, protectionOrder, false, encrypted);
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedKeyTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedKeyTokenSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedKeyTokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/EncryptedKeyTokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,13 +18,13 @@
*/
package org.apache.xml.security.stax.securityEvent;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
+
/**
* @author $Author: coheigea $
* @version $Revision: 1359731 $ $Date: 2012-07-10 16:39:40 +0100 (Tue, 10 Jul 2012) $
*/
-public class EncryptedKeyTokenSecurityEvent extends TokenSecurityEvent {
-
- //todo implement
+public class EncryptedKeyTokenSecurityEvent extends TokenSecurityEvent<SecurityToken> {
public EncryptedKeyTokenSecurityEvent() {
super(SecurityEventConstants.EncryptedKeyToken);
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyNameTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyNameTokenSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyNameTokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyNameTokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -19,11 +19,13 @@
package org.apache.xml.security.stax.securityEvent;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
+
/**
* @author $Author: coheigea $
* @version $Revision: 1354898 $ $Date: 2012-06-28 11:19:02 +0100 (Thu, 28 Jun 2012) $
*/
-public class KeyNameTokenSecurityEvent extends TokenSecurityEvent {
+public class KeyNameTokenSecurityEvent extends TokenSecurityEvent<SecurityToken> {
public KeyNameTokenSecurityEvent() {
super(SecurityEventConstants.KeyNameToken);
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyValueTokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyValueTokenSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyValueTokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/KeyValueTokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -19,12 +19,13 @@
package org.apache.xml.security.stax.securityEvent;
import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
/**
* @author $Author: coheigea $
* @version $Revision: 1354898 $ $Date: 2012-06-28 11:19:02 +0100 (Thu, 28 Jun 2012) $
*/
-public class KeyValueTokenSecurityEvent extends TokenSecurityEvent {
+public class KeyValueTokenSecurityEvent extends TokenSecurityEvent<SecurityToken> {
public enum KeyValueTokenType {
RSA,
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SecurityEventConstants.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SecurityEventConstants.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SecurityEventConstants.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SecurityEventConstants.java Mon Apr 1 13:27:45 2013
@@ -18,11 +18,14 @@
*/
package org.apache.xml.security.stax.securityEvent;
+import org.apache.xml.security.stax.ext.ComparableType;
+
/**
* @author $Author: coheigea $
* @version $Revision: 1354898 $ $Date: 2012-06-28 11:19:02 +0100 (Thu, 28 Jun 2012) $
*/
public class SecurityEventConstants {
+
public static final Event SignatureValue = new Event("SignatureValue");
public static final Event SignedElement = new Event("SignedElement");
public static final Event KeyValueToken = new Event("KeyValueToken");
@@ -34,39 +37,9 @@ public class SecurityEventConstants {
public static final Event EncryptedElement = new Event("EncryptedElement");
public static final Event EncryptedKeyToken = new Event("EncryptedKeyToken");
- public static class Event implements Comparable<Event> {
- private final String name;
-
+ public static class Event extends ComparableType<Event> {
public Event(String name) {
- this.name = name;
- }
-
- public String toString() {
- return name;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof Event) {
- Event otherEvent = (Event) obj;
- if (this.toString().equals(otherEvent.toString())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return name != null ? name.hashCode() : 0;
- }
-
- @Override
- public int compareTo(Event o) {
- return this.toString().compareTo(o.toString());
+ super(name);
}
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SignedElementSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SignedElementSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SignedElementSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/SignedElementSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,7 +18,7 @@
*/
package org.apache.xml.security.stax.securityEvent;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import java.util.List;
@@ -29,7 +29,9 @@ import java.util.List;
*/
public class SignedElementSecurityEvent extends AbstractSecuredElementSecurityEvent {
- public SignedElementSecurityEvent(SecurityToken securityToken, boolean signed, List<XMLSecurityConstants.ContentType> protectionOrder) {
- super(SecurityEventConstants.SignedElement, securityToken, protectionOrder, signed, false);
+ public SignedElementSecurityEvent(
+ InboundSecurityToken inboundSecurityToken, boolean signed,
+ List<XMLSecurityConstants.ContentType> protectionOrder) {
+ super(SecurityEventConstants.SignedElement, inboundSecurityToken, protectionOrder, signed, false);
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/TokenSecurityEvent.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/TokenSecurityEvent.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/TokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/TokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,26 +18,26 @@
*/
package org.apache.xml.security.stax.securityEvent;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
import org.apache.xml.security.stax.securityEvent.SecurityEventConstants.Event;
/**
* @author $Author: coheigea $
* @version $Revision: 1354898 $ $Date: 2012-06-28 11:19:02 +0100 (Thu, 28 Jun 2012) $
*/
-public abstract class TokenSecurityEvent extends SecurityEvent {
+public abstract class TokenSecurityEvent<T extends SecurityToken> extends SecurityEvent {
- private SecurityToken securityToken;
+ private T securityToken;
public TokenSecurityEvent(Event securityEventType) {
super(securityEventType);
}
- public SecurityToken getSecurityToken() {
+ public T getSecurityToken() {
return securityToken;
}
- public void setSecurityToken(SecurityToken securityToken) {
+ public void setSecurityToken(T securityToken) {
this.securityToken = securityToken;
}
}
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java (from r1460798, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java&r1=1460798&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityEvent/X509TokenSecurityEvent.java Mon Apr 1 13:27:45 2013
@@ -18,11 +18,13 @@
*/
package org.apache.xml.security.stax.securityEvent;
+import org.apache.xml.security.stax.securityToken.SecurityToken;
+
/**
* @author $Author: giger $
* @version $Revision: 1228829 $ $Date: 2012-01-08 11:44:13 +0000 (Sun, 08 Jan 2012) $
*/
-public class X509TokenSecurityEvent extends TokenSecurityEvent {
+public class X509TokenSecurityEvent extends TokenSecurityEvent<SecurityToken> {
public X509TokenSecurityEvent() {
super(SecurityEventConstants.X509Token);
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/InboundSecurityToken.java (from r1460798, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/InboundSecurityToken.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/InboundSecurityToken.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java&r1=1460798&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/InboundSecurityToken.java Mon Apr 1 13:27:45 2013
@@ -16,17 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.xml.security.stax.ext;
+package org.apache.xml.security.stax.securityToken;
import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
+import org.apache.xml.security.stax.ext.XMLSecurityConstants;
-import javax.xml.namespace.QName;
import java.security.Key;
import java.security.PublicKey;
-import java.security.cert.X509Certificate;
import java.util.List;
-import java.util.Map;
/**
* This class represents the different token types which can occur in WS-Security
@@ -37,97 +34,27 @@ import java.util.Map;
* @author $Author$
* @version $Revision$ $Date$
*/
-public interface SecurityToken {
-
- public enum TokenUsage {
- Signature,
- MainSignature,
- Encryption,
- MainEncryption,
- SupportingTokens,
- SignedSupportingTokens,
- EndorsingSupportingTokens,
- SignedEndorsingSupportingTokens,
- SignedEncryptedSupportingTokens,
- EncryptedSupportingTokens,
- EndorsingEncryptedSupportingTokens,
- SignedEndorsingEncryptedSupportingTokens,
- }
-
- public enum KeyInfoUsage {
- SIGNATURE_VERIFICATION,
- DECRYPTION
- }
-
- /**
- * Returns the token id aka wsu:Id
- *
- * @return The id
- */
- String getId();
-
- /**
- * Returns the absolute path to the XMLElement
- *
- * @return A list containing full qualified element names
- */
- List<QName> getElementPath();
-
- /**
- * Returns the first XMLEvent for this token
- *
- * @return
- */
- XMLSecEvent getXMLSecEvent();
-
- /**
- * Returns the token type
- *
- * @return true if asymmetric token, false if symmetric token
- */
- boolean isAsymmetric() throws XMLSecurityException;
-
- /**
- * Returns the secret key's if already initialized, null otherwise
- * @return Algorithm-URI key map
- * @throws XMLSecurityException
- */
- Map<String, Key> getSecretKey() throws XMLSecurityException;
+public interface InboundSecurityToken extends SecurityToken {
/**
* Returns the secret key
*
* @param algorithmURI for the requested key
- * @param keyUsage
+ * @param algorithmUsage
* @return The requested key for the specified algorithmURI, or null if no matching key is found
* @throws XMLSecurityException if the key can't be loaded
*/
- Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage, String correlationID) throws XMLSecurityException;
-
- /**
- * Returns the public key if one exists and already initialized, null otherwise
- * @return
- * @throws XMLSecurityException
- */
- PublicKey getPublicKey() throws XMLSecurityException;
+ Key getSecretKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws XMLSecurityException;
/**
* Returns the public key if one exist for this token type
*
* @param algorithmURI
- * @param keyUsage
+ * @param algorithmUsage
* @return The Public-Key for asymmetric algorithms
* @throws XMLSecurityException if the key can't be loaded
*/
- PublicKey getPublicKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage, String correlationID) throws XMLSecurityException;
-
- /**
- * Returns the certificate chain if one exists for this token type
- *
- * @return The certificate chain
- * @throws XMLSecurityException if the certificates can't be retrieved
- */
- X509Certificate[] getX509Certificates() throws XMLSecurityException;
+ PublicKey getPublicKey(String algorithmURI, XMLSecurityConstants.AlgorithmUsage algorithmUsage, String correlationID) throws XMLSecurityException;
/**
* Verifies the key if applicable
@@ -141,20 +68,11 @@ public interface SecurityToken {
*
* @return The wrapping SecurityToken
*/
- SecurityToken getKeyWrappingToken() throws XMLSecurityException;
-
- List<SecurityToken> getWrappedTokens() throws XMLSecurityException;
+ InboundSecurityToken getKeyWrappingToken() throws XMLSecurityException;
- void addWrappedToken(SecurityToken securityToken);
-
- /**
- * Returns the KeyIdentifierType
- *
- * @return the KeyIdentifierType
- */
- XMLSecurityConstants.TokenType getTokenType();
+ void addWrappedToken(InboundSecurityToken securityToken);
- void addTokenUsage(TokenUsage tokenUsage) throws XMLSecurityException;
+ List<? extends InboundSecurityToken> getWrappedTokens() throws XMLSecurityException;
- List<TokenUsage> getTokenUsages();
+ void addTokenUsage(SecurityTokenConstants.TokenUsage tokenUsage) throws XMLSecurityException;
}
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/OutboundSecurityToken.java (from r1460798, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/OutboundSecurityToken.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/OutboundSecurityToken.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/OutboundSecurityToken.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/OutboundSecurityToken.java&r1=1460798&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/OutboundSecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/OutboundSecurityToken.java Mon Apr 1 13:27:45 2013
@@ -16,10 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.xml.security.stax.impl.securityToken;
+package org.apache.xml.security.stax.securityToken;
import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import java.security.Key;
import java.security.PublicKey;
@@ -55,10 +54,9 @@ public interface OutboundSecurityToken {
Key getSecretKey(String algorithmURI) throws XMLSecurityException;
/**
- * Returns the public key if one exist for this token type
- *
- * @return The Public-Key for asymmetric algorithms
- * @throws XMLSecurityException if the key can't be loaded
+ * Returns the public key if one exists and already initialized, null otherwise
+ * @return
+ * @throws org.apache.xml.security.exceptions.XMLSecurityException
*/
PublicKey getPublicKey() throws XMLSecurityException;
@@ -66,11 +64,10 @@ public interface OutboundSecurityToken {
* Returns the certificate chain if one exists for this token type
*
* @return The certificate chain
- * @throws XMLSecurityException if the certificates can't be retrieved
+ * @throws org.apache.xml.security.exceptions.XMLSecurityException if the certificates can't be retrieved
*/
X509Certificate[] getX509Certificates() throws XMLSecurityException;
-
/**
* Returns the key wrapping token
*
@@ -82,10 +79,5 @@ public interface OutboundSecurityToken {
void addWrappedToken(OutboundSecurityToken securityToken);
- /**
- * Returns the KeyIdentifierType
- *
- * @return the KeyIdentifierType
- */
- XMLSecurityConstants.TokenType getTokenType();
+ SecurityTokenConstants.TokenType getTokenType();
}
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityToken.java (from r1463128, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityToken.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityToken.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java&r1=1463128&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityToken.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityToken.java Mon Apr 1 13:27:45 2013
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.xml.security.stax.ext;
+package org.apache.xml.security.stax.securityToken;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
@@ -29,36 +29,9 @@ import java.util.List;
import java.util.Map;
/**
- * This class represents the different token types which can occur in WS-Security
- * <p/>
- * Sometimes it isn't known (@see EncryptedKeyInputProcessor) which kind of Token(Asymmetric, Symmetric)
- * we have at creation time. So we use a generic interface for both types.
- *
- * @author $Author$
- * @version $Revision$ $Date$
+ * External view to a SecurityToken
*/
public interface SecurityToken {
-
- public enum TokenUsage {
- Signature,
- MainSignature,
- Encryption,
- MainEncryption,
- SupportingTokens,
- SignedSupportingTokens,
- EndorsingSupportingTokens,
- SignedEndorsingSupportingTokens,
- SignedEncryptedSupportingTokens,
- EncryptedSupportingTokens,
- EndorsingEncryptedSupportingTokens,
- SignedEndorsingEncryptedSupportingTokens,
- }
-
- public enum KeyInfoUsage {
- SIGNATURE_VERIFICATION,
- DECRYPTION
- }
-
/**
* Returns the token id aka wsu:Id
*
@@ -67,20 +40,6 @@ public interface SecurityToken {
String getId();
/**
- * Returns the absolute path to the XMLElement
- *
- * @return A list containing full qualified element names
- */
- List<QName> getElementPath();
-
- /**
- * Returns the first XMLEvent for this token
- *
- * @return
- */
- XMLSecEvent getXMLSecEvent();
-
- /**
* Returns the token type
*
* @return true if asymmetric token, false if symmetric token
@@ -95,66 +54,51 @@ public interface SecurityToken {
Map<String, Key> getSecretKey() throws XMLSecurityException;
/**
- * Returns the secret key
- *
- * @param algorithmURI for the requested key
- * @param keyUsage
- * @return The requested key for the specified algorithmURI, or null if no matching key is found
- * @throws XMLSecurityException if the key can't be loaded
- */
- Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage, String correlationID) throws XMLSecurityException;
-
- /**
* Returns the public key if one exists and already initialized, null otherwise
* @return
- * @throws XMLSecurityException
+ * @throws org.apache.xml.security.exceptions.XMLSecurityException
*/
PublicKey getPublicKey() throws XMLSecurityException;
/**
- * Returns the public key if one exist for this token type
- *
- * @param algorithmURI
- * @param keyUsage
- * @return The Public-Key for asymmetric algorithms
- * @throws XMLSecurityException if the key can't be loaded
- */
- PublicKey getPublicKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage, String correlationID) throws XMLSecurityException;
-
- /**
* Returns the certificate chain if one exists for this token type
*
* @return The certificate chain
- * @throws XMLSecurityException if the certificates can't be retrieved
+ * @throws org.apache.xml.security.exceptions.XMLSecurityException if the certificates can't be retrieved
*/
X509Certificate[] getX509Certificates() throws XMLSecurityException;
/**
- * Verifies the key if applicable
+ * Returns the key wrapping token
*
- * @throws XMLSecurityException if the key couldn't be verified or the key isn't valid
+ * @return The wrapping SecurityToken
*/
- void verify() throws XMLSecurityException;
+ SecurityToken getKeyWrappingToken() throws XMLSecurityException;
+
+ List<? extends SecurityToken> getWrappedTokens() throws XMLSecurityException;
/**
- * Returns the key wrapping token
+ * Returns the KeyIdentifier
*
- * @return The wrapping SecurityToken
+ * @return the KeyIdentifier
*/
- SecurityToken getKeyWrappingToken() throws XMLSecurityException;
+ SecurityTokenConstants.KeyIdentifier getKeyIdentifier();
- List<SecurityToken> getWrappedTokens() throws XMLSecurityException;
+ SecurityTokenConstants.TokenType getTokenType();
- void addWrappedToken(SecurityToken securityToken);
+ List<SecurityTokenConstants.TokenUsage> getTokenUsages();
/**
- * Returns the KeyIdentifierType
+ * Returns the absolute path to the XMLElement
*
- * @return the KeyIdentifierType
+ * @return A list containing full qualified element names
*/
- XMLSecurityConstants.TokenType getTokenType();
-
- void addTokenUsage(TokenUsage tokenUsage) throws XMLSecurityException;
+ List<QName> getElementPath();
- List<TokenUsage> getTokenUsages();
+ /**
+ * Returns the first XMLEvent for this token
+ *
+ * @return
+ */
+ XMLSecEvent getXMLSecEvent();
}
Added: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenConstants.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenConstants.java?rev=1463132&view=auto
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenConstants.java (added)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenConstants.java Mon Apr 1 13:27:45 2013
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.xml.security.stax.securityToken;
+
+import org.apache.xml.security.stax.ext.ComparableType;
+
+public class SecurityTokenConstants {
+
+ public static final TokenUsage TokenUsage_Signature = new TokenUsage("Signature");
+ public static final TokenUsage TokenUsage_Encryption = new TokenUsage("Encryption");
+
+ public static final KeyUsage KeyUsage_Signature_Verification = new KeyUsage("Signature_Verification");
+ public static final KeyUsage KeyUsage_Decryption = new KeyUsage("Decryption");
+
+ public static final KeyIdentifier KeyIdentifier_KeyValue = new KeyIdentifier("KeyValue");
+ public static final KeyIdentifier KeyIdentifier_KeyName = new KeyIdentifier("KeyName");
+ public static final KeyIdentifier KeyIdentifier_X509IssuerSerial = new KeyIdentifier("X509IssuerSerial");
+ public static final KeyIdentifier KeyIdentifier_X509Ski = new KeyIdentifier("X509Ski");
+ public static final KeyIdentifier KeyIdentifier_X509Certificate = new KeyIdentifier("X509Certificate");
+ public static final KeyIdentifier KeyIdentifier_X509SubjectName = new KeyIdentifier("X509SubjectName");
+ public static final KeyIdentifier KeyIdentifier_NoKeyInfo = new KeyIdentifier("NoKeyInfo");
+ public static final KeyIdentifier KeyIdentifier_EncryptedKey = new KeyIdentifier("EncryptedKey");
+
+ public static final TokenType EncryptedKeyToken = new TokenType("EncryptedKeyToken");
+ public static final TokenType X509V3Token = new TokenType("X509V3Token");
+ public static final TokenType X509V1Token = new TokenType("X509V1Token");
+ public static final TokenType X509Pkcs7Token = new TokenType("X509Pkcs7Token");
+ public static final TokenType X509PkiPathV1Token = new TokenType("X509PkiPathV1Token");
+ public static final TokenType KeyValueToken = new TokenType("KeyValueToken");
+ public static final TokenType KeyNameToken = new TokenType("KeyNameToken");
+ public static final TokenType DefaultToken = new TokenType("DefaultToken");
+
+
+ public static class TokenUsage extends ComparableType<TokenUsage> {
+ public TokenUsage(String name) {
+ super(name);
+ }
+ }
+
+ public static class KeyUsage extends ComparableType<KeyUsage> {
+ public KeyUsage(String name) {
+ super(name);
+ }
+ }
+
+ public static class KeyIdentifier extends ComparableType<KeyIdentifier> {
+ public KeyIdentifier(String name) {
+ super(name);
+ }
+ }
+
+ public static class TokenType extends ComparableType<TokenType> {
+ public TokenType(String name) {
+ super(name);
+ }
+ }
+}
Propchange: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenFactory.java (from r1460798, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/SecurityTokenFactory.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenFactory.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenFactory.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/SecurityTokenFactory.java&r1=1460798&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/impl/securityToken/SecurityTokenFactory.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenFactory.java Mon Apr 1 13:27:45 2013
@@ -16,13 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.xml.security.stax.impl.securityToken;
+package org.apache.xml.security.stax.securityToken;
import org.apache.xml.security.binding.xmldsig.KeyInfoType;
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.config.ConfigurationProperties;
-import org.apache.xml.security.stax.ext.SecurityContext;
-import org.apache.xml.security.stax.ext.SecurityToken;
+import org.apache.xml.security.stax.ext.InboundSecurityContext;
import org.apache.xml.security.stax.ext.XMLSecurityProperties;
/**
@@ -44,7 +43,8 @@ public abstract class SecurityTokenFacto
try {
@SuppressWarnings("unchecked")
- Class<SecurityTokenFactory> securityTokenFactoryClass = (Class<SecurityTokenFactory>) SecurityTokenFactory.class.getClassLoader().loadClass(stf);
+ Class<SecurityTokenFactory> securityTokenFactoryClass =
+ (Class<SecurityTokenFactory>) SecurityTokenFactory.class.getClassLoader().loadClass(stf);
securityTokenFactory = securityTokenFactoryClass.newInstance();
} catch (ClassNotFoundException e) {
throw new XMLSecurityException("algorithm.ClassDoesNotExist", new Object[]{stf}, e);
@@ -57,8 +57,8 @@ public abstract class SecurityTokenFacto
return securityTokenFactory;
}
- public abstract SecurityToken getSecurityToken(KeyInfoType keyInfoType,
- SecurityToken.KeyInfoUsage keyInfoUsage,
- XMLSecurityProperties securityProperties,
- SecurityContext securityContext) throws XMLSecurityException;
+ public abstract InboundSecurityToken getSecurityToken(
+ KeyInfoType keyInfoType, SecurityTokenConstants.KeyUsage keyUsage,
+ XMLSecurityProperties securityProperties, InboundSecurityContext inboundSecurityContext)
+ throws XMLSecurityException;
}
Copied: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenProvider.java (from r1460798, santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityTokenProvider.java)
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenProvider.java?p2=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenProvider.java&p1=santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityTokenProvider.java&r1=1460798&r2=1463132&rev=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/SecurityTokenProvider.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/securityToken/SecurityTokenProvider.java Mon Apr 1 13:27:45 2013
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.xml.security.stax.ext;
+package org.apache.xml.security.stax.securityToken;
import org.apache.xml.security.exceptions.XMLSecurityException;
@@ -26,7 +26,7 @@ import org.apache.xml.security.exception
* @author $Author$
* @version $Revision$ $Date$
*/
-public interface SecurityTokenProvider {
+public interface SecurityTokenProvider<T> {
/**
* Returns the represented SecurityToken of this object
@@ -34,7 +34,7 @@ public interface SecurityTokenProvider {
* @return The SecurityToken
* @throws XMLSecurityException if the token couldn't be loaded
*/
- <T> T getSecurityToken() throws XMLSecurityException;
+ T getSecurityToken() throws XMLSecurityException;
String getId();
}
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/InputProcessorChainTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/InputProcessorChainTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/InputProcessorChainTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/InputProcessorChainTest.java Mon Apr 1 13:27:45 2013
@@ -20,6 +20,7 @@ package org.apache.xml.security.test.sta
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.config.Init;
+import org.apache.xml.security.stax.impl.InboundSecurityContextImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -29,7 +30,6 @@ import org.apache.xml.security.stax.ext.
import org.apache.xml.security.stax.ext.XMLSecurityConstants;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
import org.apache.xml.security.stax.impl.InputProcessorChainImpl;
-import org.apache.xml.security.stax.impl.SecurityContextImpl;
import javax.xml.stream.XMLStreamException;
import java.util.HashSet;
@@ -98,7 +98,7 @@ public class InputProcessorChainTest ext
@Test
public void testAddProcessorPhase1() {
- InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new SecurityContextImpl());
+ InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new InboundSecurityContextImpl());
AbstractInputProcessor inputProcessor1 = new AbstractInputProcessor() {
};
@@ -119,7 +119,7 @@ public class InputProcessorChainTest ext
@Test
public void testAddProcessorPhase2() {
- InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new SecurityContextImpl());
+ InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new InboundSecurityContextImpl());
AbstractInputProcessor inputProcessor1 = new AbstractInputProcessor() {
};
@@ -159,7 +159,7 @@ public class InputProcessorChainTest ext
@Test
public void testAddProcessorBefore1() {
- InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new SecurityContextImpl());
+ InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new InboundSecurityContextImpl());
AbstractInputProcessor inputProcessor1 = new AbstractInputProcessor() {
};
@@ -202,7 +202,7 @@ public class InputProcessorChainTest ext
@Test
public void testAddProcessorAfter1() {
- InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new SecurityContextImpl());
+ InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new InboundSecurityContextImpl());
AbstractInputProcessor inputProcessor1 = new AbstractInputProcessor() {
};
@@ -245,7 +245,7 @@ public class InputProcessorChainTest ext
@Test
public void testAddProcessorBeforeAndAfter1() {
- InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new SecurityContextImpl());
+ InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(new InboundSecurityContextImpl());
AbstractInputProcessor inputProcessor1 = new AbstractInputProcessor() {
};
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/OutputProcessorChainTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/OutputProcessorChainTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/OutputProcessorChainTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/OutputProcessorChainTest.java Mon Apr 1 13:27:45 2013
@@ -20,6 +20,8 @@ package org.apache.xml.security.test.sta
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.config.Init;
+import org.apache.xml.security.stax.impl.InboundSecurityContextImpl;
+import org.apache.xml.security.stax.impl.OutboundSecurityContextImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -27,7 +29,6 @@ import org.junit.Test;
import org.apache.xml.security.stax.ext.*;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
import org.apache.xml.security.stax.impl.OutputProcessorChainImpl;
-import org.apache.xml.security.stax.impl.SecurityContextImpl;
import javax.xml.stream.XMLStreamException;
import java.util.HashSet;
@@ -102,7 +103,7 @@ public class OutputProcessorChainTest ex
@Test
public void testAddProcessorPhase1() {
- OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new SecurityContextImpl());
+ OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new OutboundSecurityContextImpl());
AbstractOutputProcessor outputProcessor1 = new AbstractOutputProcessor() {
};
@@ -123,7 +124,7 @@ public class OutputProcessorChainTest ex
@Test
public void testAddProcessorPhase2() {
- OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new SecurityContextImpl());
+ OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new OutboundSecurityContextImpl());
AbstractOutputProcessor outputProcessor1 = new AbstractOutputProcessor() {
};
@@ -163,7 +164,7 @@ public class OutputProcessorChainTest ex
@Test
public void testAddProcessorBefore1() {
- OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new SecurityContextImpl());
+ OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new OutboundSecurityContextImpl());
AbstractOutputProcessor outputProcessor1 = new AbstractOutputProcessor() {
};
@@ -206,7 +207,7 @@ public class OutputProcessorChainTest ex
@Test
public void testAddProcessorAfter1() {
- OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new SecurityContextImpl());
+ OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new OutboundSecurityContextImpl());
AbstractOutputProcessor outputProcessor1 = new AbstractOutputProcessor() {
};
@@ -249,7 +250,7 @@ public class OutputProcessorChainTest ex
@Test
public void testAddProcessorBeforeAndAfter1() {
- OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new SecurityContextImpl());
+ OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(new OutboundSecurityContextImpl());
AbstractOutputProcessor outputProcessor1 = new AbstractOutputProcessor() {
};
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamReaderTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamReaderTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamReaderTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamReaderTest.java Mon Apr 1 13:27:45 2013
@@ -30,7 +30,7 @@ import org.apache.xml.security.stax.ext.
import org.apache.xml.security.stax.ext.stax.XMLSecEventFactory;
import org.apache.xml.security.stax.impl.DocumentContextImpl;
import org.apache.xml.security.stax.impl.InputProcessorChainImpl;
-import org.apache.xml.security.stax.impl.SecurityContextImpl;
+import org.apache.xml.security.stax.impl.InboundSecurityContextImpl;
import org.apache.xml.security.stax.impl.XMLSecurityStreamReader;
import javax.xml.stream.XMLInputFactory;
@@ -62,7 +62,7 @@ public class XMLSecurityStreamReaderTest
public void testPassThroughDocumentEvents() throws Exception {
XMLSecurityProperties securityProperties = new XMLSecurityProperties();
securityProperties.setSkipDocumentEvents(false);
- SecurityContextImpl securityContext = new SecurityContextImpl();
+ InboundSecurityContextImpl securityContext = new InboundSecurityContextImpl();
InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(securityContext);
inputProcessorChain.addProcessor(new EventReaderProcessor());
XMLSecurityStreamReader xmlSecurityStreamReader = new XMLSecurityStreamReader(inputProcessorChain, securityProperties);
@@ -74,7 +74,7 @@ public class XMLSecurityStreamReaderTest
public void testSkipThroughDocumentEvents() throws Exception {
XMLSecurityProperties securityProperties = new XMLSecurityProperties();
securityProperties.setSkipDocumentEvents(true);
- SecurityContextImpl securityContext = new SecurityContextImpl();
+ InboundSecurityContextImpl securityContext = new InboundSecurityContextImpl();
InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(securityContext);
inputProcessorChain.addProcessor(new EventReaderProcessor());
XMLSecurityStreamReader xmlSecurityStreamReader = new XMLSecurityStreamReader(inputProcessorChain, securityProperties);
@@ -85,7 +85,7 @@ public class XMLSecurityStreamReaderTest
@Test
public void testIdentityTransformSource() throws Exception {
XMLSecurityProperties securityProperties = new XMLSecurityProperties();
- SecurityContextImpl securityContext = new SecurityContextImpl();
+ InboundSecurityContextImpl securityContext = new InboundSecurityContextImpl();
InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(securityContext);
inputProcessorChain.addProcessor(new EventReaderProcessor());
XMLSecurityStreamReader xmlSecurityStreamReader = new XMLSecurityStreamReader(inputProcessorChain, securityProperties);
@@ -100,7 +100,7 @@ public class XMLSecurityStreamReaderTest
@Test
public void testCorrectness() throws Exception {
XMLSecurityProperties securityProperties = new XMLSecurityProperties();
- SecurityContextImpl securityContext = new SecurityContextImpl();
+ InboundSecurityContextImpl securityContext = new InboundSecurityContextImpl();
DocumentContextImpl documentContext = new DocumentContextImpl();
documentContext.setEncoding("UTF-8");
InputProcessorChainImpl inputProcessorChain = new InputProcessorChainImpl(securityContext, documentContext);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java Mon Apr 1 13:27:45 2013
@@ -20,6 +20,8 @@ package org.apache.xml.security.test.sta
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.stax.config.Init;
+import org.apache.xml.security.stax.impl.InboundSecurityContextImpl;
+import org.apache.xml.security.stax.impl.OutboundSecurityContextImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -28,7 +30,6 @@ import org.custommonkey.xmlunit.XMLAsser
import org.apache.xml.security.stax.ext.*;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
import org.apache.xml.security.stax.impl.OutputProcessorChainImpl;
-import org.apache.xml.security.stax.impl.SecurityContextImpl;
import org.apache.xml.security.stax.impl.XMLSecurityStreamWriter;
import javax.xml.namespace.NamespaceContext;
@@ -54,7 +55,7 @@ public class XMLSecurityStreamWriterTest
@Test
public void testIdentityTransformResult() throws Exception {
StringWriter securityStringWriter = new StringWriter();
- SecurityContextImpl securityContext = new SecurityContextImpl();
+ OutboundSecurityContextImpl securityContext = new OutboundSecurityContextImpl();
OutputProcessorChainImpl outputProcessorChain = new OutputProcessorChainImpl(securityContext);
outputProcessorChain.addProcessor(new EventWriterProcessor(securityStringWriter));
XMLSecurityStreamWriter xmlSecurityStreamWriter = new XMLSecurityStreamWriter(outputProcessorChain);
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/DecryptionTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/DecryptionTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/DecryptionTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/encryption/DecryptionTest.java Mon Apr 1 13:27:45 2013
@@ -63,6 +63,7 @@ import org.apache.xml.security.stax.secu
import org.apache.xml.security.stax.securityEvent.EncryptedKeyTokenSecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEvent;
import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.test.stax.signature.TestSecurityEventListener;
import org.apache.xml.security.test.stax.utils.StAX2DOM;
@@ -148,7 +149,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO , "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo , "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", null);
}
@@ -204,7 +205,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedContentSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", null);
}
@@ -261,7 +262,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes256-cbc", null);
}
@@ -321,7 +322,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkMultipleEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", null);
}
@@ -386,7 +387,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedContentSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.ENCRYPTED_KEY,
+ SecurityTokenConstants.KeyIdentifier_EncryptedKey,
"http://www.w3.org/2001/04/xmlenc#aes128-cbc");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes128-cbc",
@@ -455,7 +456,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedContentSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.ENCRYPTED_KEY,
+ SecurityTokenConstants.KeyIdentifier_EncryptedKey,
"http://www.w3.org/2001/04/xmlenc#aes256-cbc");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes256-cbc",
@@ -524,7 +525,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedContentSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.ENCRYPTED_KEY,
+ SecurityTokenConstants.KeyIdentifier_EncryptedKey,
"http://www.w3.org/2001/04/xmlenc#aes192-cbc");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes192-cbc",
@@ -584,7 +585,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "");
}
@@ -644,7 +645,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes128-cbc", "");
}
@@ -706,7 +707,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes192-cbc", "");
}
@@ -770,7 +771,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptedElementSecurityEvents(securityEventListener);
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes256-cbc", "");
}
@@ -829,7 +830,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "");
}
@@ -894,7 +895,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "");
}
@@ -959,7 +960,7 @@ public class DecryptionTest extends org.
// Check the SecurityEvents
checkEncryptionToken(securityEventListener, null, secretKey,
- XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO, "");
+ SecurityTokenConstants.KeyIdentifier_NoKeyInfo, "");
checkEncryptionMethod(
securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "");
}
@@ -1073,15 +1074,15 @@ public class DecryptionTest extends org.
protected void checkEncryptionToken(
TestSecurityEventListener securityEventListener,
X509Certificate cert, Key key,
- XMLSecurityConstants.XMLKeyIdentifierType keyIdentifierType,
+ SecurityTokenConstants.KeyIdentifier keyIdentifier,
String algorithm) throws XMLSecurityException {
- if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO) {
+ if (SecurityTokenConstants.KeyIdentifier_NoKeyInfo.equals(keyIdentifier)) {
DefaultTokenSecurityEvent tokenEvent =
(DefaultTokenSecurityEvent) securityEventListener.getSecurityEvent(SecurityEventConstants.DefaultToken);
assertNotNull(tokenEvent);
Key processedKey = tokenEvent.getSecurityToken().getSecretKey().values().iterator().next();
assertEquals(processedKey, key);
- } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.ENCRYPTED_KEY) {
+ } else if (SecurityTokenConstants.KeyIdentifier_EncryptedKey.equals(keyIdentifier)) {
EncryptedKeyTokenSecurityEvent tokenEvent =
(EncryptedKeyTokenSecurityEvent) securityEventListener.getSecurityEvent(
SecurityEventConstants.EncryptedKeyToken);
@@ -1104,11 +1105,11 @@ public class DecryptionTest extends org.
boolean matchedKeywrapAlgorithm = false;
for (SecurityEvent event : algorithmEvents) {
AlgorithmSuiteSecurityEvent algorithmEvent = (AlgorithmSuiteSecurityEvent) event;
- if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.Enc) {
+ if (XMLSecurityConstants.Enc.equals(algorithmEvent.getAlgorithmUsage())) {
assertEquals(encryptionAlgorithm, algorithmEvent.getAlgorithmURI());
matchedEncryptionAlgorithm = true;
- } else if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.Sym_Key_Wrap
- || algorithmEvent.getKeyUsage() == XMLSecurityConstants.Asym_Key_Wrap) {
+ } else if (XMLSecurityConstants.Sym_Key_Wrap.equals(algorithmEvent.getAlgorithmUsage())
+ || XMLSecurityConstants.Asym_Key_Wrap.equals(algorithmEvent.getAlgorithmUsage())) {
assertEquals(keywrapAlgorithm, algorithmEvent.getAlgorithmURI());
matchedKeywrapAlgorithm = true;
}
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/performance/AbstractPerformanceTest.java Mon Apr 1 13:27:45 2013
@@ -22,6 +22,7 @@ import org.apache.xml.security.encryptio
import org.apache.xml.security.exceptions.XMLSecurityException;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.stax.ext.*;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
import org.apache.xml.security.test.stax.utils.XmlReaderToWriter;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.utils.XMLUtils;
@@ -145,7 +146,7 @@ public abstract class AbstractPerformanc
XMLSecurityConstants.SIGNATURE
};
xmlSecurityProperties.setOutAction(actions);
- xmlSecurityProperties.setSignatureKeyIdentifierType(XMLSecurityConstants.XMLKeyIdentifierType.X509_CERTIFICATE);
+ xmlSecurityProperties.setSignatureKeyIdentifier(SecurityTokenConstants.KeyIdentifier_X509Certificate);
xmlSecurityProperties.setSignatureKey(key);
xmlSecurityProperties.setSignatureCerts(new X509Certificate[]{cert});
Modified: santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java?rev=1463132&r1=1463131&r2=1463132&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java (original)
+++ santuario/xml-security-java/trunk/src/test/java/org/apache/xml/security/test/stax/signature/AbstractSignatureVerificationTest.java Mon Apr 1 13:27:45 2013
@@ -27,6 +27,7 @@ import org.apache.xml.security.stax.impl
import org.apache.xml.security.stax.impl.securityToken.X509SecurityToken;
import org.apache.xml.security.stax.impl.securityToken.X509SubjectNameSecurityToken;
import org.apache.xml.security.stax.securityEvent.*;
+import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
import org.apache.xml.security.test.dom.DSNamespaceContext;
import org.apache.xml.security.test.stax.utils.XMLSecEventAllocator;
import org.apache.xml.security.transforms.Transforms;
@@ -294,7 +295,7 @@ public class AbstractSignatureVerificati
// C14n algorithm
for (SecurityEvent event : algorithmEvents) {
AlgorithmSuiteSecurityEvent algorithmEvent = (AlgorithmSuiteSecurityEvent) event;
- if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.C14n) {
+ if (XMLSecurityConstants.C14n.equals(algorithmEvent.getAlgorithmUsage())) {
assertEquals(c14nAlgorithm, algorithmEvent.getAlgorithmURI());
}
}
@@ -302,7 +303,7 @@ public class AbstractSignatureVerificati
// Digest algorithm
for (SecurityEvent event : algorithmEvents) {
AlgorithmSuiteSecurityEvent algorithmEvent = (AlgorithmSuiteSecurityEvent) event;
- if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.Dig) {
+ if (XMLSecurityConstants.Dig.equals(algorithmEvent.getAlgorithmUsage())) {
assertEquals(digestAlgorithm, algorithmEvent.getAlgorithmURI());
}
}
@@ -310,8 +311,8 @@ public class AbstractSignatureVerificati
// Signature method
for (SecurityEvent event : algorithmEvents) {
AlgorithmSuiteSecurityEvent algorithmEvent = (AlgorithmSuiteSecurityEvent) event;
- if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.Asym_Sig
- || algorithmEvent.getKeyUsage() == XMLSecurityConstants.Sym_Sig) {
+ if (XMLSecurityConstants.Asym_Sig.equals(algorithmEvent.getAlgorithmUsage())
+ || XMLSecurityConstants.Sym_Sig.equals(algorithmEvent.getAlgorithmUsage())) {
assertEquals(signatureMethod, algorithmEvent.getAlgorithmURI());
}
}
@@ -355,19 +356,19 @@ public class AbstractSignatureVerificati
TestSecurityEventListener securityEventListener,
X509Certificate cert,
Key key,
- XMLSecurityConstants.XMLKeyIdentifierType keyIdentifierType
+ SecurityTokenConstants.KeyIdentifier keyIdentifier
) throws XMLSecurityException {
- if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.KEY_VALUE) {
+ if (SecurityTokenConstants.KeyIdentifier_KeyValue.equals(keyIdentifier)) {
KeyValueTokenSecurityEvent tokenEvent =
(KeyValueTokenSecurityEvent) securityEventListener.getSecurityEvent(SecurityEventConstants.KeyValueToken);
assertNotNull(tokenEvent);
- } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.NO_KEY_INFO) {
+ } else if (SecurityTokenConstants.KeyIdentifier_NoKeyInfo.equals(keyIdentifier)) {
DefaultTokenSecurityEvent tokenEvent =
(DefaultTokenSecurityEvent) securityEventListener.getSecurityEvent(SecurityEventConstants.DefaultToken);
assertNotNull(tokenEvent);
Key processedKey = tokenEvent.getSecurityToken().getSecretKey().values().iterator().next();
assertEquals(processedKey, key);
- } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.KEY_NAME) {
+ } else if (SecurityTokenConstants.KeyIdentifier_KeyName.equals(keyIdentifier)) {
KeyNameTokenSecurityEvent tokenEvent =
(KeyNameTokenSecurityEvent) securityEventListener.getSecurityEvent(SecurityEventConstants.KeyNameToken);
assertNotNull(tokenEvent);
@@ -381,16 +382,13 @@ public class AbstractSignatureVerificati
X509SecurityToken x509SecurityToken =
(X509SecurityToken) tokenEvent.getSecurityToken();
assertNotNull(x509SecurityToken);
- if (keyIdentifierType ==
- XMLSecurityConstants.XMLKeyIdentifierType.X509_CERTIFICATE) {
+ if (SecurityTokenConstants.KeyIdentifier_X509Certificate.equals(keyIdentifier)) {
assertEquals(cert, x509SecurityToken.getX509Certificates()[0]);
- } else if (keyIdentifierType ==
- XMLSecurityConstants.XMLKeyIdentifierType.X509_SUBJECT_NAME) {
+ } else if (SecurityTokenConstants.KeyIdentifier_X509SubjectName.equals(keyIdentifier)) {
Key processedKey = x509SecurityToken.getPublicKey();
assertEquals(processedKey, cert.getPublicKey());
assertNotNull(((X509SubjectNameSecurityToken) x509SecurityToken).getSubjectName());
- } else if (keyIdentifierType ==
- XMLSecurityConstants.XMLKeyIdentifierType.X509_ISSUER_SERIAL) {
+ } else if (SecurityTokenConstants.KeyIdentifier_X509IssuerSerial.equals(keyIdentifier)) {
Key processedKey = x509SecurityToken.getPublicKey();
assertEquals(processedKey, cert.getPublicKey());
assertNotNull(((X509IssuerSerialSecurityToken) x509SecurityToken).getIssuerName());