org.wso2.solutions.identity.relyingparty
Class TokenVerifier

java.lang.Object
  extended by org.wso2.solutions.identity.relyingparty.TokenVerifier

public class TokenVerifier
extends java.lang.Object

A SAML token is sent to a web application in a CardSpace login attempt and this can be used for decryption and verification of those tokens.


Constructor Summary
TokenVerifier()
           
 
Method Summary
 org.w3c.dom.Element decryptToken(java.lang.String token, java.security.PrivateKey serviceKey)
          Decrypt the given token (as a java.lang.String with the given private key.
 java.util.Hashtable getAttributeTable()
          Returns the list of attributes extracted from the SAMLAttributeStatements in the verified SAML assertion.
 java.util.List getCertificates()
           
 java.lang.String getIssuerName()
           
 org.w3c.dom.Element getKeyInfoElement()
           
 void setIssuerName(java.lang.String issuer)
           
 boolean verifyDecryptedToken(org.w3c.dom.Element decryptedElem)
          Verify the signature of a given SAML token (decrypted)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenVerifier

public TokenVerifier()
Method Detail

decryptToken

public org.w3c.dom.Element decryptToken(java.lang.String token,
                                        java.security.PrivateKey serviceKey)
                                 throws RelyingPartyException
Decrypt the given token (as a java.lang.String with the given private key.

Parameters:
token - Serialized SAML token
serviceKey - Private key to be used for decryption.
Returns:
Decrypted SAML token element.
Throws:
RelyingPartyException

verifyDecryptedToken

public boolean verifyDecryptedToken(org.w3c.dom.Element decryptedElem)
                             throws RelyingPartyException
Verify the signature of a given SAML token (decrypted)

Parameters:
decryptedElem - SAML token element
Returns:
true if verification is successful and false if unsuccessful.
Throws:
org.opensaml.SAMLException
RelyingPartyException

getAttributeTable

public java.util.Hashtable getAttributeTable()
Returns the list of attributes extracted from the SAMLAttributeStatements in the verified SAML assertion.

Returns:
List of attributes as a java.util.Hashtable

getCertificates

public java.util.List getCertificates()

getKeyInfoElement

public org.w3c.dom.Element getKeyInfoElement()

getIssuerName

public java.lang.String getIssuerName()

setIssuerName

public void setIssuerName(java.lang.String issuer)