Class MGL_OTP

java.lang.Object
tech.mgl.core.utils.security.MGL_OTP

public class MGL_OTP extends Object
Author:
Hotpot
  • Constructor Details

  • Method Details

    • getCode

      public String getCode()
    • getAccount

      public String getAccount()
    • getIssuer

      public String getIssuer()
    • getSecretKey

      public String getSecretKey()
    • getOffset

      public int getOffset()
    • setOffset

      public void setOffset(int offset)
      设置偏移时间
      Parameters:
      offset -
    • authCode

      public Boolean authCode(String codes, String savedSecret)
      验证动态密码
      Parameters:
      codes - 动态码
      savedSecret - 生成的私钥,存在与数据库等
      Returns:
      Boolean
    • authCode

      public Boolean authCode(String codes)
    • authCode

      public Boolean authCode()
    • generateSecretKey

      public String generateSecretKey()
      生成SecretKey
      Returns:
      String
    • getQRBarcodeURL

      public String getQRBarcodeURL(String user, String host, String secret)
    • getGoogleAuthenticatorBarCode

      public String getGoogleAuthenticatorBarCode()
    • createQRCode

      public void createQRCode(String barCodeData, String filePath, int height, int width) throws com.google.zxing.WriterException, IOException
      Throws:
      com.google.zxing.WriterException
      IOException
    • qrcode

      public void qrcode() throws Exception
      Throws:
      Exception