Author: anil.saldhana(a)jboss.com
Date: 2010-11-18 11:21:29 -0500 (Thu, 18 Nov 2010)
New Revision: 557
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustConstants.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/writers/WSTrustRSTWriter.java
Log:
use constants
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustConstants.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustConstants.java 2010-11-17
16:22:52 UTC (rev 556)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/WSTrustConstants.java 2010-11-18
16:21:29 UTC (rev 557)
@@ -112,8 +112,12 @@
public interface XMLDSig
{
String DSIG_NS = "http://www.w3.org/2000/09/xmldsig#";
+ String EXPONENT = "Exponent";
String KEYINFO = "KeyInfo";
+ String KEYVALUE = "KeyValue";
+ String MODULUS = "Modulus";
String PREFIX = "ds";
+ String RSA_KEYVALUE = "RSAKeyValue";
String X509DATA = "X509Data";
String X509CERT = "X509Certificate";
}
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/writers/WSTrustRSTWriter.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/writers/WSTrustRSTWriter.java 2010-11-17
16:22:52 UTC (rev 556)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/writers/WSTrustRSTWriter.java 2010-11-18
16:21:29 UTC (rev 557)
@@ -257,8 +257,9 @@
else if (useKeyTypeValue instanceof byte[])
{
byte[] certificate = (byte[]) useKeyTypeValue;
- StaxUtil.writeStartElement(writer, "dsig",
"X509Certificate", WSTrustConstants.DSIG_NS);
- StaxUtil.writeNameSpace( writer, "dsig", WSTrustConstants.DSIG_NS);
+ StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.PREFIX ,
WSTrustConstants.XMLDSig.X509CERT,
+ WSTrustConstants.DSIG_NS);
+ StaxUtil.writeNameSpace( writer, WSTrustConstants.XMLDSig.PREFIX ,
WSTrustConstants.DSIG_NS);
StaxUtil.writeCharacters(writer, new String(certificate));
StaxUtil.writeEndElement(writer);
}
@@ -274,8 +275,8 @@
private void writeKeyValueType(KeyValueType type) throws ProcessingException
{
- StaxUtil.writeStartElement(writer, "dsig", WSTrustConstants.KEY_VALUE,
WSTrustConstants.DSIG_NS);
- StaxUtil.writeNameSpace(writer, "dsig", WSTrustConstants.DSIG_NS);
+ StaxUtil.writeStartElement(writer, WSTrustConstants.XMLDSig.PREFIX ,
WSTrustConstants.XMLDSig.KEYVALUE, WSTrustConstants.DSIG_NS);
+ StaxUtil.writeNameSpace(writer, WSTrustConstants.XMLDSig.PREFIX ,
WSTrustConstants.DSIG_NS);
if (type.getContent().size() == 0)
throw new ProcessingException("KeyValueType must contain at least one
value");
@@ -292,16 +293,16 @@
private void writeRSAKeyValueType(RSAKeyValueType type) throws ProcessingException
{
- StaxUtil.writeStartElement(writer, "dsig", "RSAKeyValue",
WSTrustConstants.DSIG_NS);
+ StaxUtil.writeStartElement(writer, "dsig",
WSTrustConstants.XMLDSig.RSA_KEYVALUE , WSTrustConstants.DSIG_NS);
// write the rsa key modulus.
byte[] modulus = type.getModulus();
- StaxUtil.writeStartElement(writer, "dsig", "Modulus",
WSTrustConstants.DSIG_NS);
+ StaxUtil.writeStartElement(writer, "dsig",
WSTrustConstants.XMLDSig.MODULUS , WSTrustConstants.DSIG_NS);
StaxUtil.writeCharacters(writer, new String(modulus));
StaxUtil.writeEndElement(writer);
// write the rsa key exponent.
byte[] exponent = type.getExponent();
- StaxUtil.writeStartElement(writer, "dsig", "Exponent",
WSTrustConstants.DSIG_NS);
+ StaxUtil.writeStartElement(writer, "dsig",
WSTrustConstants.XMLDSig.EXPONENT , WSTrustConstants.DSIG_NS);
StaxUtil.writeCharacters(writer, new String(exponent));
StaxUtil.writeEndElement(writer);