Skip to content

Commit df28bfa

Browse files
committed
Port README updates to the Javadoc overview.
1 parent 7f2ecc5 commit df28bfa

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/main/java/overview.html

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</head>
2727

2828
<body>
29-
<p>java-otp is a library for generating one-time passwords using the <a href="https://tools.ietf.org/html/rfc4226">HOTP (RFC 4226)</a> or <a href="https://tools.ietf.org/html/rfc6238">TOTP (RFC 6238)</a> passwords in Java.</p>
29+
<p>java-otp is a Java library for generating <a href="https://tools.ietf.org/html/rfc4226">HOTP (RFC 4226)</a> or <a href="https://tools.ietf.org/html/rfc6238">TOTP (RFC 6238)</a> one-time passwords.</p>
3030

3131
<h1>Usage</h1>
3232

@@ -46,21 +46,14 @@ <h1>Usage</h1>
4646

4747
<p>Armed with a secret key, we can deterministically generate one-time passwords for any timestamp:</p>
4848

49-
<pre>final Date now = new Date();
50-
final Date later = new Date(now.getTime() + TimeUnit.SECONDS.toMillis(30));
49+
<pre>final Instant now = Instant.now();
50+
final Instant later = now.plus(totp.getTimeStep());
5151

52-
System.out.format("Current password: %06d\n", totp.generateOneTimePassword(secretKey, now));
53-
System.out.format("Future password: %06d\n", totp.generateOneTimePassword(secretKey, later));</pre>
52+
System.out.format("Current password: %06d\n", totp.generateOneTimePassword(key, now));
53+
System.out.format("Future password: %06d\n", totp.generateOneTimePassword(key, later));</pre>
5454

5555
<h1>License and copyright</h1>
5656

57-
<p>Copyright (c) 2016 Jon Chambers</p>
58-
59-
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
60-
61-
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
62-
63-
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
64-
57+
<p>java-otp is copyright (c) 2016 Jon Chambers and available under the <a href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
6558
</body>
6659
</html>

0 commit comments

Comments
 (0)