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.SymmetricKeyBinding
All Implemented Interfaces:
SecurityPolicy, java.lang.Cloneable

public class SymmetricKeyBinding
extends WSSPolicy

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


Constructor Summary
SymmetricKeyBinding()
          Default constructor
SymmetricKeyBinding(java.lang.String keyIdentifier, java.lang.String keyAlgorithm)
           
 
Method Summary
 java.lang.Object clone()
          Clone operator
 boolean equals(WSSPolicy policy)
          equals operator
 boolean equalsIgnoreTargets(WSSPolicy binding)
           
 java.lang.String getKeyAlgorithm()
           
 java.lang.String getKeyIdentifier()
           
 javax.crypto.SecretKey getSecretKey()
           
 java.lang.String getType()
          Get the type of the policy.
 void setKeyAlgorithm(java.lang.String keyAlgorithm)
          set the Key Algorithm of the Symmetric Key
 void setKeyIdentifier(java.lang.String keyIdentifier)
          set the key identifier for the symmetric key
 void setSecretKey(javax.crypto.SecretKey secretKey)
          Set the symmetric key
 java.lang.String toString()
           
 
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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymmetricKeyBinding

public SymmetricKeyBinding()
Default constructor


SymmetricKeyBinding

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

setKeyIdentifier

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

Parameters:
keyIdentifier -

getKeyIdentifier

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

setKeyAlgorithm

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

Parameters:
keyAlgorithm -

getKeyAlgorithm

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

setSecretKey

public void setSecretKey(javax.crypto.SecretKey secretKey)
Set the symmetric key

Parameters:
secretKey - the SecretKey

getSecretKey

public javax.crypto.SecretKey getSecretKey()
Returns:
SecretKey the symmetric key

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 java.lang.Object clone()
Clone operator

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

getType

public java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright ? 2005 Sun Microsystems, Inc. All Rights Reserved.