@ Override public String decrypt ( String cipherText ) { this . decryptionLock . lock ( ) ; try { String decryptedValue = null ; try { byte [ ] bytes = Base64 . getDecoder ( ) . decode ( cipherText ) ; decryptedValue = new String ( decryptCipher . doFinal ( bytes ) , charset ) ; } catch ( UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e ) { logger . error ( "DefaultAESCBCCipher failed to decrypt text" , e ) ; throw new JsonDBException ( "DefaultAESCBCCipher failed to decrypt text" , e ) ; } return decryptedValue ; } finally { this . decryptionLock . unlock ( ) ; } }
A method to decrypt the provided cipher text .