com.ibm.websphere.wssecurity.wssapi.decryption

Interface WSSDecryption


  1. public interface WSSDecryption
This interface is responsible for the decryption component. There are the values to set as default. Following is the sample code. The sample code of generating the callbackhandler is shown in the X509Token.
    WSSFactory factory = WSSFactory.getInstance();
    WSSConsumingContext concont = factory.newWSSConsumingContext();

    X509ConsumeCallbackHandler callbackhandler =  generateCallbackHandler(); 
                        // see X509ConsumeCallbackHandler
    WSSDecryption dec = factory.newWSSDecryption(X509Token.class, callbackhandler);

    concont.add(dec);
 
See Also:
WSSDecryptPart

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
AES128
The URI for the data encryption algorithm, AES 128: http://www.w3.org/2001/04/xmlenc#aes128-cbc.
  1. static
  2. java.lang.String
AES192
The URI for the data encryption algorithm, AES 192: http://www.w3.org/2001/04/xmlenc#aes192-cbc.
  1. static
  2. java.lang.String
AES256
The URI for the data encryption algorithm, AES 256: http://www.w3.org/2001/04/xmlenc#aes256-cbc.
  1. static
  2. int
BODY_CONTENT
The keyword for the body content of the SOAP message as a decrypt target.
  1. static
  2. java.lang.String
KW_AES128
The URI for the key wrap algorithm, key wrap AES 128: http://www.w3.org/2001/04/xmlenc#kw-aes128.
  1. static
  2. java.lang.String
KW_AES192
The URI for the key wrap algorithm, key wrap AES 192: http://www.w3.org/2001/04/xmlenc#kw-aes192.
  1. static
  2. java.lang.String
KW_AES256
The URI for the key wrap algorithm, key wrap AES 256: http://www.w3.org/2001/04/xmlenc#kw-aes256.
  1. static
  2. java.lang.String
KW_RSA_OAEP
The URI for the key wrap algorithm, key wrap RSA-OAEP: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.
  1. static
  2. java.lang.String
KW_RSA15
The URI for the key wrap algorithm, key wrap RSA 1.5 : http://www.w3.org/2001/04/xmlenc#rsa-1_5.
  1. static
  2. java.lang.String
KW_TRIPLE_DES
The URI for the key wrap algorithm, key wrap triple DES: http://www.w3.org/2001/04/xmlenc#kw-tripledes.
  1. static
  2. int
SIGNATURE
The keyword for the signature element as a decrypt target.
  1. static
  2. java.lang.String
TRIPLE_DES
The URI for the data encryption algorithm, triple DES: http://www.w3.org/2001/04/xmlenc#tripledes-cbc.
  1. static
  2. int
USERNAME_TOKEN
The keyword for the user name token element as a decrypt target.

Method Summary

Modifier and Type Method and Description
  1. void
addAllowedEncryptionMethod(java.lang.String algorithm)
Adds the data encryption method to decrypted data.
  1. void
addAllowedKeyEncryptionMethod(java.lang.String algorithm)
Adds the key encryption method to decrypt the shared key.
  1. void
addRequiredDecryptHeader(javax.xml.namespace.QName header)
Adds the header in the SOAP Header, specified by QName, as a decrypted part.
  1. void
addRequiredDecryptPart(int keyword)
Adds the keyword of decrypted part, such as BODY_CONTENT, USERNAME_TOKEN, or SIGNATURE.
  1. void
addRequiredDecryptPart(WSSDecryptPart part)
Adds the WSSDecryptPart object as a decrypted part.
  1. void
addRequiredDecryptPart(WSSVerification verification)
Adds the WSSVerification object as a decrypted part.
  1. void
addRequiredDecryptPartByXPath(java.lang.String xpath)
Adds an XPath expression as a decrypted part.
  1. void
addToken(java.lang.Class tokenClass,javax.security.auth.callback.CallbackHandler callbackHandler)
Adds the information of the candidate token used to decrypt.
  1. void
addToken(java.lang.Class tokenClass,javax.security.auth.callback.CallbackHandler callbackHandler,java.lang.String loginConfigName)
Adds the information of the candidate token that is used for the decryption.
  1. void
encryptKey(boolean isEncrypt)
Call this method with true as an argument, when the shared key is encrypted.

Field Detail

BODY_CONTENT

  1. static final int BODY_CONTENT
The keyword for the body content of the SOAP message as a decrypt target.
See Also:

USERNAME_TOKEN

  1. static final int USERNAME_TOKEN
The keyword for the user name token element as a decrypt target.
See Also:

SIGNATURE

  1. static final int SIGNATURE
The keyword for the signature element as a decrypt target.
See Also:

TRIPLE_DES

  1. static final java.lang.String TRIPLE_DES
The URI for the data encryption algorithm, triple DES: http://www.w3.org/2001/04/xmlenc#tripledes-cbc.
See Also:

AES128

  1. static final java.lang.String AES128
The URI for the data encryption algorithm, AES 128: http://www.w3.org/2001/04/xmlenc#aes128-cbc.
See Also:

AES192

  1. static final java.lang.String AES192
The URI for the data encryption algorithm, AES 192: http://www.w3.org/2001/04/xmlenc#aes192-cbc.
See Also:

AES256

  1. static final java.lang.String AES256
The URI for the data encryption algorithm, AES 256: http://www.w3.org/2001/04/xmlenc#aes256-cbc.
See Also:

KW_TRIPLE_DES

  1. static final java.lang.String KW_TRIPLE_DES
The URI for the key wrap algorithm, key wrap triple DES: http://www.w3.org/2001/04/xmlenc#kw-tripledes.
It is an algorithm for the WS-Secure Conversation.
See Also:

KW_AES128

  1. static final java.lang.String KW_AES128
The URI for the key wrap algorithm, key wrap AES 128: http://www.w3.org/2001/04/xmlenc#kw-aes128.
It is an algorithm for the WS-Secure Conversation.
See Also:

KW_AES192

  1. static final java.lang.String KW_AES192
The URI for the key wrap algorithm, key wrap AES 192: http://www.w3.org/2001/04/xmlenc#kw-aes192.
It is an algorithm for the WS-Secure Conversation.
See Also:

KW_AES256

  1. static final java.lang.String KW_AES256
The URI for the key wrap algorithm, key wrap AES 256: http://www.w3.org/2001/04/xmlenc#kw-aes256.
It is an algorithm for the WS-Secure Conversation.
See Also:

KW_RSA15

  1. static final java.lang.String KW_RSA15
The URI for the key wrap algorithm, key wrap RSA 1.5 : http://www.w3.org/2001/04/xmlenc#rsa-1_5.
See Also:

KW_RSA_OAEP

  1. static final java.lang.String KW_RSA_OAEP
The URI for the key wrap algorithm, key wrap RSA-OAEP: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p.
See Also:

Method Detail

addRequiredDecryptPart

  1. void addRequiredDecryptPart(int keyword)
  2. throws WSSException
Adds the keyword of decrypted part, such as BODY_CONTENT, USERNAME_TOKEN, or SIGNATURE.
Parameters:
keyword - part to be decrypted
Throws:
WSSException - if the keyword is not valid.

addRequiredDecryptPart

  1. void addRequiredDecryptPart(WSSDecryptPart part)
Adds the WSSDecryptPart object as a decrypted part.
Parameters:
part - part to be decrypted

addRequiredDecryptPart

  1. void addRequiredDecryptPart(WSSVerification verification)
Adds the WSSVerification object as a decrypted part.
Parameters:
verification - part to be decrypted

addRequiredDecryptHeader

  1. void addRequiredDecryptHeader(javax.xml.namespace.QName header)
Adds the header in the SOAP Header, specified by QName, as a decrypted part.
Parameters:
header - part to be decrypted

addRequiredDecryptPartByXPath

  1. void addRequiredDecryptPartByXPath( java.lang.String xpath)
Adds an XPath expression as a decrypted part.
Parameters:
xpath - part to be decrypted

addAllowedEncryptionMethod

  1. void addAllowedEncryptionMethod( java.lang.String algorithm)
  2. throws WSSException
Adds the data encryption method to decrypted data.
Parameters:
algorithm - data encryption method
Throws:
WSSException - the algorithm is not supported.

addAllowedKeyEncryptionMethod

  1. void addAllowedKeyEncryptionMethod( java.lang.String algorithm)
  2. throws WSSException
Adds the key encryption method to decrypt the shared key.
Parameters:
algorithm - key encryption method
Throws:
WSSException - the algorithm is not supported.

encryptKey

  1. void encryptKey(boolean isEncrypt)
Call this method with true as an argument, when the shared key is encrypted. Call this method with false as an argument, when the shared key is not encrypted. The default is true.
Parameters:
isEncrypt - true if the shared key which is encrypted is required.
false if the shared key which is not encrypted is required.

addToken

  1. void addToken(java.lang.Class tokenClass,
  2. javax.security.auth.callback.CallbackHandler callbackHandler,
  3. java.lang.String loginConfigName)
  4. throws WSSException
Adds the information of the candidate token that is used for the decryption.
Parameters:
tokenClass - class of the security token
callbackHandler - callback handler
loginConfigName - name of the JAAS login module
Throws:
WSSException - if the arguments are not valid.

addToken

  1. void addToken(java.lang.Class tokenClass,
  2. javax.security.auth.callback.CallbackHandler callbackHandler)
  3. throws WSSException
Adds the information of the candidate token used to decrypt.
Parameters:
tokenClass - class of the security token
callbackHandler - callback handler
Throws: