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

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

public class PrivateKeyBinding
extends WSSPolicy

Objects of this class act as KeyBindings for AuthenticationTokens such as AuthenticationTokenPolicy.X509CertificateBinding and AuthenticationTokenPolicy.SAMLAssertionBinding. When associated with an AuthenticationToken they represent the PrivateKey associated with the AuthenticationToken.


Constructor Summary
PrivateKeyBinding()
          Default constructor
PrivateKeyBinding(java.lang.String keyIdentifier, java.lang.String keyAlgorithm)
          Constructor
 
Method Summary
 java.lang.Object clone()
          clone operator
 boolean equals(WSSPolicy binding)
          equality operator
 boolean equalsIgnoreTargets(WSSPolicy binding)
           
 java.lang.String getKeyAlgorithm()
           
 java.lang.String getKeyIdentifier()
           
 java.security.PrivateKey getPrivateKey()
           
 java.lang.String getType()
          Get the type of the policy.
 void setKeyAlgorithm(java.lang.String keyAlgorithm)
          set the KeyAlgorithm of this Private Key.
 void setKeyIdentifier(java.lang.String keyIdentifier)
          set the keyIdentifier for the Private Key
 void setPrivateKey(java.security.PrivateKey privateKey)
          set the private key instance
 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

PrivateKeyBinding

public PrivateKeyBinding()
Default constructor


PrivateKeyBinding

public PrivateKeyBinding(java.lang.String keyIdentifier,
                         java.lang.String keyAlgorithm)
Constructor

Parameters:
keyIdentifier - identifier for the Private Key
keyAlgorithm - identified for the Key Algorithm
Method Detail

setKeyIdentifier

public void setKeyIdentifier(java.lang.String keyIdentifier)
set the keyIdentifier for the Private Key

Parameters:
keyIdentifier - Key Identifier for the Private Key

getKeyIdentifier

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

setKeyAlgorithm

public void setKeyAlgorithm(java.lang.String keyAlgorithm)
set the KeyAlgorithm of this Private Key. Implementation Note: This KeyAlgorithm is not used by XWS-Runtime, refer setKeyAlgorithm on X509CertificateBinding, SAMLAssertionBinding, and SymmetricKeyBinding instead.

Parameters:
keyAlgorithm - KeyAlgorithm of this Private Key

getKeyAlgorithm

public java.lang.String getKeyAlgorithm()
Returns:
KeyAlgorithm of this Private Key

setPrivateKey

public void setPrivateKey(java.security.PrivateKey privateKey)
set the private key instance

Parameters:
privateKey - PrivateKey for this PrivateKeyBinding

getPrivateKey

public java.security.PrivateKey getPrivateKey()
Returns:
PrivateKey associated with this PrivateKeyBinding

equals

public boolean equals(WSSPolicy binding)
equality operator

Specified by:
equals in class WSSPolicy
Parameters:
binding - the Policy to be checked for equality
Returns:
true if the argument binding is equal to this PrivateKeyBinding.
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:
a clone of this PrivateKeyBinding
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.