Apache CXF API

org.apache.cxf.sts.token.provider
Class DefaultSubjectProvider

java.lang.Object
  extended by org.apache.cxf.sts.token.provider.DefaultSubjectProvider
All Implemented Interfaces:
SubjectProvider

public class DefaultSubjectProvider
extends Object
implements SubjectProvider

A default implementation of SubjectProvider to create a SAML Assertion. The Subject name is the name of the current principal, the subject name qualifier is a default URL that can be configured, and the subject confirmation method is created according to the token type and key type. If the Subject Confirmation Method is SymmetricKey or PublicKey, the appropriate KeyInfoBean object is created and attached to the Subject.


Constructor Summary
DefaultSubjectProvider()
           
 
Method Summary
protected static org.apache.wss4j.common.saml.bean.KeyInfoBean createKeyInfo(X509Certificate certificate, byte[] secret, Document doc, EncryptionProperties encryptionProperties, org.apache.wss4j.common.crypto.Crypto encryptionCrypto)
          Create an EncryptedKey KeyInfo.
protected static org.apache.wss4j.common.saml.bean.KeyInfoBean createKeyInfo(X509Certificate certificate, PublicKey publicKey)
          Create a KeyInfoBean that contains an X.509 certificate or Public Key
 org.apache.wss4j.common.saml.bean.SubjectBean getSubject(TokenProviderParameters providerParameters, Document doc, byte[] secret)
          Get a SubjectBean object.
protected  String getSubjectConfirmationMethod(String tokenType, String keyType)
          Get the SubjectConfirmation method given a tokenType and keyType
 void setSubjectNameIDFormat(String subjectNameIDFormat)
          Set the SubjectNameIDFormat.
 void setSubjectNameQualifier(String subjectNameQualifier)
          Set the SubjectNameQualifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSubjectProvider

public DefaultSubjectProvider()
Method Detail

setSubjectNameQualifier

public void setSubjectNameQualifier(String subjectNameQualifier)
Set the SubjectNameQualifier.


setSubjectNameIDFormat

public void setSubjectNameIDFormat(String subjectNameIDFormat)
Set the SubjectNameIDFormat.


getSubject

public org.apache.wss4j.common.saml.bean.SubjectBean getSubject(TokenProviderParameters providerParameters,
                                                                Document doc,
                                                                byte[] secret)
Get a SubjectBean object.

Specified by:
getSubject in interface SubjectProvider

getSubjectConfirmationMethod

protected String getSubjectConfirmationMethod(String tokenType,
                                              String keyType)
Get the SubjectConfirmation method given a tokenType and keyType


createKeyInfo

protected static org.apache.wss4j.common.saml.bean.KeyInfoBean createKeyInfo(X509Certificate certificate,
                                                                             PublicKey publicKey)
Create a KeyInfoBean that contains an X.509 certificate or Public Key


createKeyInfo

protected static org.apache.wss4j.common.saml.bean.KeyInfoBean createKeyInfo(X509Certificate certificate,
                                                                             byte[] secret,
                                                                             Document doc,
                                                                             EncryptionProperties encryptionProperties,
                                                                             org.apache.wss4j.common.crypto.Crypto encryptionCrypto)
                                                                      throws org.apache.wss4j.common.ext.WSSecurityException
Create an EncryptedKey KeyInfo.

Throws:
org.apache.wss4j.common.ext.WSSecurityException

Apache CXF API

Apache CXF