public static String encode ( String decoded_string , String crypto_algorithm , String crypto_key ) throws InvalidPasswordEncodingException , UnsupportedCryptoAlgorithmException { HashMap < String , String > props = new HashMap < String , String > ( ) ; if ( crypto_key != null ) { props . put ( PROPERTY_CRYPTO_KEY , crypto_key ) ; } return encode ( decoded_string , crypto_algorithm , props ) ; }
Encode the provided string with the specified algorithm and the crypto key If the decoded_string is already encoded the string will be decoded and then encoded by using the specified crypto algorithm . Use this method for encoding the string by using the AES encryption with the specific crypto key . Note that this method is only avaiable for the Liberty profile .