@ FFDCIgnore ( { BadPaddingException . class , Exception . class } ) private final void decrypt ( ) throws InvalidTokenException { byte [ ] tokenData ; try { tokenData = LTPAKeyUtil . decrypt ( encryptedBytes . clone ( ) , sharedKey , cipher ) ; checkTokenBytes ( tokenData ) ; String UTF8TokenString = toUTF8String ( tokenData ) ; String [ ] userFields = LTPATokenizer . parseToken ( UTF8TokenString ) ; Map < String , ArrayList < String > > attribs = LTPATokenizer . parseUserData ( userFields [ 0 ] ) ; userData = new UserData ( attribs ) ; String tokenString = toSimpleString ( tokenData ) ; String [ ] fields = LTPATokenizer . parseToken ( tokenString ) ; String [ ] expirationArray = userData . getAttributes ( AttributeNameConstants . WSTOKEN_EXPIRATION ) ; if ( expirationArray != null && expirationArray [ expirationArray . length - 1 ] != null ) { // the new expiration value inside the signature expirationInMilliseconds = Long . parseLong ( expirationArray [ expirationArray . length - 1 ] ) ; } else { // the old expiration value outside of the signature expirationInMilliseconds = Long . parseLong ( fields [ 1 ] ) ; } byte [ ] signature = Base64Coder . base64Decode ( Base64Coder . getBytes ( fields [ 2 ] ) ) ; setSignature ( signature ) ; } catch ( BadPaddingException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Caught BadPaddingException while decrypting token, this is only a critical problem if decryption should have worked." , e ) ; } throw new InvalidTokenException ( e . getMessage ( ) , e ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Error decrypting; " + e ) ; } throw new InvalidTokenException ( e . getMessage ( ) , e ) ; } }
Decrypt the encrypted token bytes passed into the constructor .