com.sun.xml.wss.impl.policy.mls
Class SymmetricKeyBinding

java.lang.Object
  extended by com.sun.xml.wss.impl.policy.MLSPolicy
      extended by com.sun.xml.wss.impl.policy.mls.WSSPolicy
          extended by com.sun.xml.wss.impl.policy.mls.KeyBindingBase
              extended by com.sun.xml.wss.impl.policy.mls.SymmetricKeyBinding
All Implemented Interfaces:
SecurityPolicy, Cloneable

public class SymmetricKeyBinding
extends KeyBindingBase

A policy representing a SymmetricKey that can be used as the KeyBinding for a SignaturePolicy or an EncryptionPolicy.


Field Summary
 
Fields inherited from class com.sun.xml.wss.impl.policy.mls.KeyBindingBase
claims, claimsDialect, INCLUDE_ALWAYS, INCLUDE_ALWAYS_TO_RECIPIENT, INCLUDE_ALWAYS_TO_RECIPIENT_VER2, INCLUDE_ALWAYS_VER2, INCLUDE_NEVER, INCLUDE_NEVER_VER2, INCLUDE_ONCE, INCLUDE_ONCE_VER2, includeToken, issuer, policyToken
 
Fields inherited from class com.sun.xml.wss.impl.policy.mls.WSSPolicy
_featureBinding, _isOptional, _keyBinding, _policyIdentifier, bsp, UUID
 
Fields inherited from class com.sun.xml.wss.impl.policy.MLSPolicy
readonly
 
Constructor Summary
SymmetricKeyBinding()
          Default constructor
SymmetricKeyBinding(String keyIdentifier, String keyAlgorithm)
           
 
Method Summary
 Object clone()
          Clone operator
 boolean equals(WSSPolicy policy)
          equals operator
 boolean equalsIgnoreTargets(WSSPolicy binding)
           
 String getCertAlias()
           
 String getKeyAlgorithm()
           
 String getKeyIdentifier()
           
 SecretKey getSecretKey()
           
 String getType()
          Get the type of the policy.
 boolean getUseReceivedSecret()
           
 MLSPolicy newX509CertificateKeyBinding()
          Create and set the KeyBinding for this WSSPolicy to an X509CertificateBinding
 void setCertAlias(String certAlias)
           
 void setKeyAlgorithm(String keyAlgorithm)
          set the Key Algorithm of the Symmetric Key
 void setKeyIdentifier(String keyIdentifier)
          set the key identifier for the symmetric key
 void setSecretKey(SecretKey secretKey)
          Set the symmetric key
 void setUseReceivedSecret(boolean useReceivedSecret)
           
 String toString()
           
 boolean usesEKSHA1KeyBinding()
           
 void usesEKSHA1KeyBinding(boolean value)
           
 
Methods inherited from class com.sun.xml.wss.impl.policy.mls.KeyBindingBase
getClaims, getIncludeToken, getIssuer, policyTokenWasSet, setClaims, setIncludeToken, setIssuer, setPolicyTokenFlag
 
Methods inherited from class com.sun.xml.wss.impl.policy.mls.WSSPolicy
getFeatureBinding, getKeyBinding, getPolicyIdentifier, getUUID, isBSP, isBSP, isOptional, isOptional, setFeatureBinding, setKeyBinding, setPolicyIdentifier, setUUID
 
Methods inherited from class com.sun.xml.wss.impl.policy.MLSPolicy
isReadOnly, isReadOnly
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymmetricKeyBinding

public SymmetricKeyBinding()
Default constructor


SymmetricKeyBinding

public SymmetricKeyBinding(String keyIdentifier,
                           String keyAlgorithm)
Parameters:
keyIdentifier - identifier for Key
keyAlgorithm - Key Algorithm
Method Detail

setKeyIdentifier

public void setKeyIdentifier(String keyIdentifier)
set the key identifier for the symmetric key

Parameters:
keyIdentifier -

getKeyIdentifier

public String getKeyIdentifier()
Returns:
key identifier for the symmetric key

setCertAlias

public void setCertAlias(String certAlias)

getCertAlias

public String getCertAlias()

setUseReceivedSecret

public void setUseReceivedSecret(boolean useReceivedSecret)

getUseReceivedSecret

public boolean getUseReceivedSecret()

setKeyAlgorithm

public void setKeyAlgorithm(String keyAlgorithm)
set the Key Algorithm of the Symmetric Key

Parameters:
keyAlgorithm -

getKeyAlgorithm

public String getKeyAlgorithm()
Returns:
keyAlgorithm for the Symmetric Key

setSecretKey

public void setSecretKey(SecretKey secretKey)
Set the symmetric key

Parameters:
secretKey - the SecretKey

getSecretKey

public SecretKey getSecretKey()
Returns:
SecretKey the symmetric key

newX509CertificateKeyBinding

public MLSPolicy newX509CertificateKeyBinding()
Create and set the KeyBinding for this WSSPolicy to an X509CertificateBinding

Returns:
a new X509CertificateBinding as a KeyBinding for this WSSPolicy
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy

usesEKSHA1KeyBinding

public boolean usesEKSHA1KeyBinding()

usesEKSHA1KeyBinding

public void usesEKSHA1KeyBinding(boolean value)

equals

public boolean equals(WSSPolicy policy)
Description copied from class: WSSPolicy
equals operator

Specified by:
equals in class WSSPolicy
Parameters:
policy - the policy to be compared for equality
Returns:
true if the argument policy is equal to this
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy, PrivateKeyBinding, SymmetricKeyBinding

equalsIgnoreTargets

public boolean equalsIgnoreTargets(WSSPolicy binding)
Specified by:
equalsIgnoreTargets in class WSSPolicy

clone

public Object clone()
Clone operator

Specified by:
clone in class WSSPolicy
Returns:
clone of this policy
See Also:
SignaturePolicy, EncryptionPolicy, AuthenticationTokenPolicy

getType

public String getType()
Description copied from interface: SecurityPolicy
Get the type of the policy.

Implementation Note: Useful to avoid instanceof checks and String.equals checks

Returns:
the type of the policy

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.