com.ibm.websphere.crypto
Class PasswordUtil
- java.lang.Object
com.ibm.websphere.crypto.PasswordUtil
- public class PasswordUtil
- extends java.lang.Object
PasswordUtil
class provides utility functions to encode and decode passwords.
This functionality is not new in WebSphere Applicaiton Server, but it is the first time
this function becomes available as WebSphere public programming interface.
InvalidPasswordDecodingException
,
InvalidPasswordEncodingException
,
UnsupportedCryptoAlgorithmException
Field Summary
Modifier and Type | Field and Description |
---|---|
|
DEFAULT_CRYPTO_ALGORITHM
|
|
STRING_CONVERSION_CODE
|
|
thisClass
|
Constructor Summary
Constructor and Description |
---|
PasswordUtil()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
decode(java.lang.String encoded_string)
This method decodes the specified encoded data.
|
|
encode(java.lang.String decoded_string)
This method encodes the specified data using defaul encoding algorithm.
|
|
encode(java.lang.String decoded_string,java.lang.String crypto_algorithm)
This method encodes the specified data using the specified encoding algorithm.
|
|
getCryptoAlgorithm(java.lang.String encoded_string)
This method extracts name of the encoding algorithm specified in the encoding algorithm tag in the ecoded data string.
|
|
getCryptoAlgorithmTag(java.lang.String encoded_string)
This method extracts the encoding algorithm tag embedded in the ecoded data string.
|
|
isEncrypted(java.lang.String encoded_string)
This method returns true if the input string contains an encoded algorithm tag.
|
|
isValidCryptoAlgorithm(java.lang.String crypto_algorithm)
This method returns true if the specified encoded algorithm is a supported algorithm or
if the input String is null.
|
|
isValidCryptoAlgorithmTag(java.lang.String crypto_algorithm_tag)
This method returns true if input String represents a valid encoding algorithm tag or
if the input String is null.
|
|
passwordDecode(java.lang.String encoded_string)
This method decodes the specified encoded data.
|
|
passwordEncode(java.lang.String decoded_string)
This method encodes the specified data using default encoding algorithm.
|
|
passwordEncode(java.lang.String decoded_string,java.lang.String crypto_algorithm)
This method encodes the specified data using the specified encoding algorithm.
|
|
removeCryptoAlgorithmTag(java.lang.String encoded_string)
This method removesw the encoding algorithm tag embedded in the input String.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
DEFAULT_CRYPTO_ALGORITHM
- public static final java.lang.String DEFAULT_CRYPTO_ALGORITHM
STRING_CONVERSION_CODE
- public static final java.lang.String STRING_CONVERSION_CODE
thisClass
- public static final java.lang.Class thisClass
Constructor Detail
PasswordUtil
- public PasswordUtil()
Method Detail
decode
- public static final java.lang.String decode( java.lang.String encoded_string)
- throws InvalidPasswordDecodingException
- UnsupportedCryptoAlgorithmException
java.lang.String
object that contains decoded data. InvalidPasswordDecodingException
- will be thrown if the input param is null, if the encoding algorithm tag is missing, or if the inputs data is
not a valid encoded string. UnsupportedCryptoAlgorithmException
- will be thrown if the encoding algorithm specified in the encoded data is not a supported algorithm. encode
- public static final java.lang.String encode( java.lang.String decoded_string)
- throws InvalidPasswordEncodingException
- UnsupportedCryptoAlgorithmException
This method encodes the specified data using defaul encoding algorithm.
java.lang.String
object that contains encoded data. InvalidPasswordEncodingException
- will be thrown if the input param is null or if the input data string contains an encoding algorithm tag. UnsupportedCryptoAlgorithmException
- will be thrown if the default encoding algorithm is not defined properly. encode
- public static final java.lang.String encode( java.lang.String decoded_string,
- java.lang.String crypto_algorithm)
- throws InvalidPasswordEncodingException
- UnsupportedCryptoAlgorithmException
This method encodes the specified data using the specified encoding algorithm.
java.lang.String
object that contains encoded data. InvalidPasswordEncodingException
- will be thrown if the input param is null or if the input data string contains an encoding algorithm tag. UnsupportedCryptoAlgorithmException
- will be thrown if the specified encoding algorithm is not supported by the implementation. getCryptoAlgorithm
- public static final java.lang.String getCryptoAlgorithm( java.lang.String encoded_string)
This method extracts name of the encoding algorithm specified in the encoding algorithm tag in the ecoded data string.
java.lang.String
object that contains the extracted encoding algorithm name. getCryptoAlgorithmTag
- public static final java.lang.String getCryptoAlgorithmTag( java.lang.String encoded_string)
This method extracts the encoding algorithm tag embedded in the ecoded data string.
java.lang.String
object that contains the extracted encoding algorithm tag. isEncrypted
- public static final boolean isEncrypted( java.lang.String encoded_string)
This method returns true if the input string contains an encoded algorithm tag.
isValidCryptoAlgorithm
- public static final boolean isValidCryptoAlgorithm( java.lang.String crypto_algorithm)
This method returns true if the specified encoded algorithm is a supported algorithm or if the input String is null.
isValidCryptoAlgorithmTag
- public static final boolean isValidCryptoAlgorithmTag( java.lang.String crypto_algorithm_tag)
This method returns true if input String represents a valid encoding algorithm tag or if the input String is null.
passwordDecode
- public static final java.lang.String passwordDecode( java.lang.String encoded_string)
This method decodes the specified encoded data. This method returns the input String if it is not encoded.
java.lang.String
object that contains decoded data. passwordEncode
- public static final java.lang.String passwordEncode( java.lang.String decoded_string)
This method encodes the specified data using default encoding algorithm. If the input String is already encoded, this method first decodes it and then encodes it using the default encoding algorithm.
java.lang.String
object that contains encoded data. passwordEncode
- public static final java.lang.String passwordEncode( java.lang.String decoded_string,
- java.lang.String crypto_algorithm)
This method encodes the specified data using the specified encoding algorithm. If the input String is already encoded, this method first decodes it and then encodes it using the specified encoding algorithm. This methodd returns a null String if the specified encoding algorithm is not a supported algorithm.
java.lang.String
object that contains encoded data. removeCryptoAlgorithmTag
- public static final java.lang.String removeCryptoAlgorithmTag( java.lang.String encoded_string)
This method removesw the encoding algorithm tag embedded in the input String.
java.lang.String
object that contains the encoded data with the encoding algorithm tag removed.
This method decodes the specified encoded data.