String decrypt ( String str ) throws DecryptException { if ( str == null ) { return null ; } try { initCiphers ( ) ; byte [ ] ciphertext = Base64 . decodeBase64 ( str ) ; byte [ ] cleartext = this . decryptCipher . doFinal ( ciphertext ) ; return new String ( cleartext ) ; } catch ( NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException ex ) { throw new DecryptException ( ex ) ; } catch ( InvalidKeyException ex ) { throw new AssertionError ( ex ) ; } }
Decrypts the provided hex string . This method converts a hex string to a byte array and passes the array to a decryption cipher . If an exception is thrown this instance may no longer be usable .