Author: anil.saldhana(a)jboss.com
Date: 2008-12-16 12:33:03 -0500 (Tue, 16 Dec 2008)
New Revision: 168
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/HTTPRedirectUtil.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/JBossSAMLBaseFactory.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/SecurityActions.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/DeflateUtil.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLSignatureUtil.java
Log:
update javadoc
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/HTTPRedirectUtil.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/HTTPRedirectUtil.java 2008-12-16
02:36:57 UTC (rev 167)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/HTTPRedirectUtil.java 2008-12-16
17:33:03 UTC (rev 168)
@@ -33,6 +33,14 @@
*/
public class HTTPRedirectUtil
{
+ /**
+ * Send the response to the redirected destination while
+ * adding the character encoding of "UTF-8" as well as
+ * adding headers for cache-control and Pragma
+ * @param destination Destination URI where the response needs to redirect
+ * @param response HttpServletResponse
+ * @throws IOException
+ */
public static void sendRedirect(String destination, HttpServletResponse response)
throws IOException
{
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/JBossSAMLBaseFactory.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/JBossSAMLBaseFactory.java 2008-12-16
02:36:57 UTC (rev 167)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/JBossSAMLBaseFactory.java 2008-12-16
17:33:03 UTC (rev 168)
@@ -64,14 +64,11 @@
return assertionObjectFactory.createAttributeStatementType();
}
- public static AttributeType createAttribute(String attributeValue)
- {
- AttributeType att = assertionObjectFactory.createAttributeType();
- JAXBElement<Object> attValue =
assertionObjectFactory.createAttributeValue(attributeValue);
- att.getAttributeValue().add(attValue);
- return att;
- }
-
+ /**
+ * Create an attribute type given a role name
+ * @param roleName
+ * @return
+ */
public static AttributeType createAttributeForRole(String roleName)
{
AttributeType att = assertionObjectFactory.createAttributeType();
@@ -85,6 +82,11 @@
return att;
}
+ /**
+ * Create an AttributeStatement given an attribute
+ * @param attributeValue
+ * @return
+ */
public static AttributeStatementType createAttributeStatement(String attributeValue)
{
AttributeStatementType attribStatement =
assertionObjectFactory.createAttributeStatementType();
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/SecurityActions.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/SecurityActions.java 2008-12-16
02:36:57 UTC (rev 167)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/factories/SecurityActions.java 2008-12-16
17:33:03 UTC (rev 168)
@@ -31,6 +31,10 @@
*/
class SecurityActions
{
+ /**
+ * Get the Thread Context ClassLoader
+ * @return
+ */
static ClassLoader getContextClassLoader()
{
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/DeflateUtil.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/DeflateUtil.java 2008-12-16
02:36:57 UTC (rev 167)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/DeflateUtil.java 2008-12-16
17:33:03 UTC (rev 168)
@@ -38,6 +38,12 @@
*/
public class DeflateUtil
{
+ /**
+ * Apply DEFLATE encoding
+ * @param message
+ * @return
+ * @throws IOException
+ */
public static byte[] encode(byte[] message) throws IOException
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -49,14 +55,25 @@
return baos.toByteArray();
}
+ /**
+ * Apply DEFLATE encoding
+ * @param message
+ * @return
+ * @throws IOException
+ */
public static byte[] encode(String message) throws IOException
{
return encode(message.getBytes());
}
+ /**
+ * DEFLATE decoding
+ * @param msgToDecode the message that needs decoding
+ * @return
+ */
public static InputStream decode(byte[] msgToDecode)
{
ByteArrayInputStream bais = new ByteArrayInputStream(msgToDecode);
return new InflaterInputStream(bais, new Inflater(true));
}
-}
+}
\ No newline at end of file
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLSignatureUtil.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLSignatureUtil.java 2008-12-16
02:36:57 UTC (rev 167)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLSignatureUtil.java 2008-12-16
17:33:03 UTC (rev 168)
@@ -179,6 +179,13 @@
return doc;
}
+ /**
+ * Validate a signed document with the given public key
+ * @param signedDoc
+ * @param publicKey
+ * @return
+ * @throws Exception
+ */
public static boolean validate(Document signedDoc, Key publicKey) throws Exception
{
NodeList nl = signedDoc.getElementsByTagNameNS(XMLSignature.XMLNS,
"Signature");
@@ -193,14 +200,26 @@
return coreValidity;
}
-
+
+ /**
+ * Marshall a SignatureType to output stream
+ * @param signature
+ * @param os
+ * @throws Exception
+ */
public static void marshall(SignatureType signature, OutputStream os) throws
Exception
{
JAXBElement<SignatureType> jsig = objectFactory.createSignature(signature);
Marshaller marshaller = JBossSAMLBaseFactory.getValidatingMarshaller(pkgName,
schemaLocation);
marshaller.marshal(jsig, os);
}
-
+
+ /**
+ * Marshall the signed document to an output stream
+ * @param signedDocument
+ * @param os
+ * @throws Exception
+ */
public static void marshall(Document signedDocument, OutputStream os) throws
Exception
{
TransformerFactory tf = TransformerFactory.newInstance();
Show replies by date