wstrange/GoogleAuth — pull request #3 by emcrisostomo (2014-02-12 14:37:45+00:00)
Title: Changes on my GoogleAuth fork

Hi Warren,

I'm Enrico, the owner of the blog you inspired from when you created the GoogleAuth repository. Nice to meet you. :)

I've forked your GoogleAuth repo yesterday and I've applied some changes. Unfortunately, some of them are breaking (such as method name changes), but I think the package will benefit from them. Here's a summarised list of changes I'm asking you to review together and pull:
- Improved JavaDoc throughout the package.
- Use an internal SecureRandom instance (which is thread-safe), properly seeded, and provide a reSeed() method for clients.
- Use SecureRandom#nextBytes() method instead of #generateSeed() (this comes from an older pull request which, IMHO, is not using the SecureRandom properly.)
- Wrap all exceptions in a GoogleAuthenticatorException extending RuntimeException.
- Generate verification code.
- Make room for 5 scratch codes (as Google does) and generate them (they're not returned yet, though).
- The key, the verification code and the QR logic has been encapsulated into the GoogleAuthenticatorKey class.
- Improve windowSize management:
- Make it AtomicInteger.
- Add get/set methods.
- Provide method overrides to use a default window size or specify a custom one.
- Update tests.

Cheers,
-- Enrico