Class TokenBuilder
java.lang.Object
com.sun.xml.ws.security.opt.impl.keyinfo.TokenBuilder
- All Implemented Interfaces:
TokenBuilder
- Direct Known Subclasses:
DerivedKeyTokenBuilder,IssuedTokenBuilder,KerberosTokenBuilder,KeyValueTokenBuilder,SamlTokenBuilder,SCTBuilder,SymmetricTokenBuilder,UsernameTokenBuilder,X509TokenBuilder
- Author:
- K.Venugopal@sun.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JAXBFilterProcessingContextprotected WSSElementFactoryprotected KeyInfoprotected static final Loggerprotected SecurityHeader -
Constructor Summary
ConstructorsConstructorDescriptionTokenBuilder(JAXBFilterProcessingContext context) Creates a new instance of TokenBuilder -
Method Summary
Modifier and TypeMethodDescriptionprotected DirectReferencebuildDirectReference(String id, String valueType) builds the direct reference and sets the id and valueType in itprotected KeyInfobuildKeyInfo(Reference ref, String strId) builds SecurityTokenReference with the reference element provided and with the id.protected KeyInfocreates key info with the SecurityTokenReference providedprotected KeyInfobuildKeyInfo(PublicKey pubKey) builds key value with the public key provided Uses thid key value to construct key infoprotected KeyIdentifierbuildKeyInfoWithEKSHA1(String ekSHA1Ref) builds keyInfo with the given encrypted key sha1 referenceprotected KeyIdentifierbuildKeyInfoWithKI(AuthenticationTokenPolicy.X509CertificateBinding binding, String refType) builds keyInfo with the given X509 certificate bindingprotected KeyIdentifierbuildKeyInfoWithKIKerberos(AuthenticationTokenPolicy.KerberosTokenBinding binding, String refType) builds keyInfo with the given kerberos token bindingprotected KeyValuebuildKeyValue(PublicKey pubKey) builds RSA key value with the public key providedprotected KeyInfobuildKIWithKeyName(String name) protected SecurityTokenReferencecreates a new SecurityTokenReference with the reference element providedprotected SecurityTokenReferencecreates a new SecurityTokenReference with the reference element provided sets the id provided in the SecurityTokenReference if the security policy is a SignaturePolicyprotected BinarySecurityTokencreateBinarySecurityToken(AuthenticationTokenPolicy.X509CertificateBinding binding, X509Certificate x509Cert) if a BinarySecurityToken already exists in the security header with the id of the binding returns it else creates a BinarySecurityToken with the X509 certificate provided Adds the username token to the security headerprotected BinarySecurityTokencreateKerberosBST(AuthenticationTokenPolicy.KerberosTokenBinding binding, byte[] kerbToken) if an BinarySecurityToken already exists in the security header with the id of the binding returns it else creates a new BinarySecurityToken with the kerboros token provided Adds the BinarySecurityToken to the security headerprotected UsernameTokencreateUsernameToken(AuthenticationTokenPolicy.UsernameTokenBinding binding, UsernameToken unToken) if an UsernameToken already exists in the security header with the id of the binding returns it else sets the id of the binding in the usernametoken provided and returns it Adds the username token to the security headerprotected StringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sun.xml.ws.security.opt.api.keyinfo.TokenBuilder
process
-
Field Details
-
logger
-
context
-
securityHeader
-
elementFactory
-
keyInfo
-
-
Constructor Details
-
TokenBuilder
Creates a new instance of TokenBuilder
-
-
Method Details
-
createBinarySecurityToken
protected BinarySecurityToken createBinarySecurityToken(AuthenticationTokenPolicy.X509CertificateBinding binding, X509Certificate x509Cert) throws com.sun.xml.wss.XWSSecurityException if a BinarySecurityToken already exists in the security header with the id of the binding returns it else creates a BinarySecurityToken with the X509 certificate provided Adds the username token to the security header- Parameters:
binding- X509CertificateBindingx509Cert- X509Certificate- Returns:
- BinarySecurityToken
- Throws:
com.sun.xml.wss.XWSSecurityException
-
createUsernameToken
protected UsernameToken createUsernameToken(AuthenticationTokenPolicy.UsernameTokenBinding binding, UsernameToken unToken) throws com.sun.xml.wss.XWSSecurityException if an UsernameToken already exists in the security header with the id of the binding returns it else sets the id of the binding in the usernametoken provided and returns it Adds the username token to the security header- Parameters:
binding- UsernameTokenBindingunToken- UsernameToken- Returns:
- UsernameToken
- Throws:
com.sun.xml.wss.XWSSecurityException
-
createKerberosBST
protected BinarySecurityToken createKerberosBST(AuthenticationTokenPolicy.KerberosTokenBinding binding, byte[] kerbToken) throws com.sun.xml.wss.XWSSecurityException if an BinarySecurityToken already exists in the security header with the id of the binding returns it else creates a new BinarySecurityToken with the kerboros token provided Adds the BinarySecurityToken to the security header- Parameters:
binding- KerberosTokenBindingkerbToken- byte[]- Returns:
- BinarySecurityToken
- Throws:
com.sun.xml.wss.XWSSecurityException
-
buildSTR
creates a new SecurityTokenReference with the reference element provided sets the id provided in the SecurityTokenReference if the security policy is a SignaturePolicy- Parameters:
strId- Stringref- Reference- Returns:
- SecurityTokenReference
-
buildSTR
creates a new SecurityTokenReference with the reference element provided- Parameters:
ref- Reference- Returns:
- SecurityTokenReference
-
buildKeyInfo
builds SecurityTokenReference with the reference element provided and with the id. creates key info with this SecurityTokenReference- Parameters:
ref- ReferencstrId- String- Returns:
- KeyInfo
-
buildKeyInfo
creates key info with the SecurityTokenReference provided- Parameters:
str- SecurityTokenReference- Returns:
- KeyInfo
-
buildKeyInfo
builds key value with the public key provided Uses thid key value to construct key info- Parameters:
pubKey- PublicKey- Returns:
- KeyInfo
-
buildKeyValue
builds RSA key value with the public key provided- Parameters:
pubKey- PublicKey- Returns:
- KeyValue
-
buildKIWithKeyName
-
buildDirectReference
builds the direct reference and sets the id and valueType in it- Parameters:
id- StringvalueType- String- Returns:
- DirectReference
-
buildKeyInfoWithKI
protected KeyIdentifier buildKeyInfoWithKI(AuthenticationTokenPolicy.X509CertificateBinding binding, String refType) throws com.sun.xml.wss.XWSSecurityException builds keyInfo with the given X509 certificate binding- Parameters:
binding- X509CertificateBindingrefType- String- Returns:
- KeyIdentifier
- Throws:
com.sun.xml.wss.XWSSecurityException
-
buildKeyInfoWithKIKerberos
protected KeyIdentifier buildKeyInfoWithKIKerberos(AuthenticationTokenPolicy.KerberosTokenBinding binding, String refType) throws com.sun.xml.wss.XWSSecurityException builds keyInfo with the given kerberos token binding- Parameters:
binding- KerberosTokenBindingrefType- String- Returns:
- KeyIdentifier
- Throws:
com.sun.xml.wss.XWSSecurityException
-
buildKeyInfoWithEKSHA1
builds keyInfo with the given encrypted key sha1 reference- Parameters:
ekSHA1Ref- String- Returns:
- KeyIdentifier
-
getID
-
getKeyInfo
- Returns:
- javax.xml.crypto.dsig.keyinfo.KeyInfo
-