jchambers / java-otp

A one-time password (HOTP/TOTP) library for Java
MIT License
455 stars 122 forks source link

Import secrets #18

Closed 0xlee closed 3 years ago

0xlee commented 4 years ago

I didn't find any examples how to import secrets. Since I wrote an example which works for me, I wanted to share it.

Here it says that the secret key is encoded with base32, so the kotlin code looks like following:

val key = SecretKeySpec(Base32().decode("<YOUR-SECRET>"), "RAW")

I hope it's ok to share this. I think the best would be to show this example in README.