public void decrypt ( byte [ ] key ) throws IOException , ClassNotFoundException { if ( _clearCreds != null ) { return ; } _key = key ; try { _contents = SecureUtil . getAESCipher ( Cipher . DECRYPT_MODE , _key ) . doFinal ( _contents ) ; } catch ( GeneralSecurityException gse ) { IOException ioe = new IOException ( "Failed to decrypt credentials" ) ; ioe . initCause ( gse ) ; throw ioe ; } ByteArrayInputStream byteIn = new ByteArrayInputStream ( _contents ) ; ObjectInputStream cipherIn = new ObjectInputStream ( byteIn ) ; _clearCreds = ( Credentials ) cipherIn . readObject ( ) ; }
Decrypts the request after transmission .