@Override
    public String getOtp() throws OtpInfoException {
        checkSecret();

        try {
            OTP otp = TOTP.generateOTP(getSecret(), getAlgorithm(true), getDigits(), getPeriod());
            return otp.toString();
        } catch (InvalidKeyException | NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
@Test
    public void testTotpInfoOtp() throws OtpInfoException {
        for (TOTPTest.Vector vector : TOTPTest.VECTORS) {
            byte[] seed = TOTPTest.getSeed(vector.Algo);
            TotpInfo info = new TotpInfo(seed, vector.Algo, 8, TotpInfo.DEFAULT_PERIOD);
            assertEquals(vector.OTP, info.getOtp(vector.Time));
        }
    }