com.rsa.swsj
Interface XMLSecurityHandler


public interface XMLSecurityHandler

This interface provides security operations with required information, such as a verification key. This interface is implemented by applications. The methods in this interface are called by the toolkit.


Method Summary

 void

needHMACPassword(XMLSignature sig)

This method is called when the toolkit needs the password for verifying HMAC signatures.

 void

needPublicKeys(XMLSignature sig)

This method is called when the toolkit needs a public key in order to verify a signature.

 void

needSecretKey(XMLEncryption enc)

This method is called when the toolkit needs the secret key in order to decrypt data.

 void

needTransportKey(XMLEncryption enc)

This method is called when the toolkit needs the transport key in order to decrypt data.

 void

needWrappingKey(XMLEncryption enc)

This method is called when the toolkit needs the wrapping keys in order to decrypt data.

 void

operationBegin(XMLSecurityOperation op)

This method is invoked by the toolkit before it starts processing a security operation.

 void

operationEnd(XMLSecurityOperation op)

This method is invoked by the toolkit after the processing of each security operation.

 

Method Detail

needPublicKeys

public void needPublicKeys(XMLSignature sig)
This method is called when the toolkit needs a public key in order to verify a signature. When invoked, the application should call sig.setCertificates() or sig.setPublicKeys() to inform the signature operation about the known set of certificates and public keys to try. (First, certificates are tried, then public keys.) The application can find more details of the signature operation by inspecting the SecurityParameters from sig.

Parameters:
sig - The signature operation that needs a key for verification.

needTransportKey

public void needTransportKey(XMLEncryption enc)
This method is called when the toolkit needs the transport key in order to decrypt data. When invoked, the application should call enc.setTransportKey() to set the transport key to use. The application can find more details of the encryption operation by inspecting the SecurityParameters from enc.

Parameters:
enc - The encryption operation that is missing the transport key.

needSecretKey

public void needSecretKey(XMLEncryption enc)
This method is called when the toolkit needs the secret key in order to decrypt data. It is not normally necessary to set a specific secret key to use when this method is invoked, the application should generally just return immediately. If there is a specific secret key to use, specify it by calling enc.setSecretKey(). The application can find more details of the encryption operation by inspecting the SecurityParameters from enc.

Parameters:
enc - The encryption operation that is missing the secret key.

needWrappingKey

public void needWrappingKey(XMLEncryption enc)
This method is called when the toolkit needs the wrapping keys in order to decrypt data. When invoked, the application should call enc.setWrappingKey() to set the wrapping key to use. The application can find more details of the encryption operation by inspecting the SecurityParameters from enc.

Parameters:
enc - The encryption operation that is missing the wrapping key.

needHMACPassword

public void needHMACPassword(XMLSignature sig)
This method is called when the toolkit needs the password for verifying HMAC signatures. When invoked, the application should call sig.setHMACPassword() to set the HMAC password to use. The application can find more details of the signature operation by inspecting the SecurityParameters from sig.

Parameters:
sig - The signature operation that is missing the HMAC password.

operationBegin

public void operationBegin(XMLSecurityOperation op)
This method is invoked by the toolkit before it starts processing a security operation. It is invoked once for all security operations. In the implementation of this method, an application can invoke the skip() method for the specified XMLSecurityOperation to indicate that the toolkit must not process this operation.

Parameters:
op - The security operation being processed.

operationEnd

public void operationEnd(XMLSecurityOperation op)
                  throws SWSJException
This method is invoked by the toolkit after the processing of each security operation. It is invoked once for all security operations. In the implementation of this method, an application may query the StatusInfo for the specified XMLSecurityOperation and then do one of the following:

Parameters:
op - The security operation being processed.
Throws:
SWSJException - If the application is designed to throw an exception here.