def generateHotpSecretKeyUri(self, secretKey, issuer, userDisplayName): digits = self.hotpConfiguration["digits"] secretKeyBase32 = self.toBase32(secretKey) otpKey = OTPKey(secretKeyBase32, OTPType.HOTP) label = issuer + " %s" % userDisplayName otpAuthURI = OTPAuthURIBuilder.fromKey(otpKey).label(label).issuer(issuer).digits(digits).build() return otpAuthURI.toUriString()
def generateHotpSecretKeyUri(self, secretKey, issuer, userDisplayName): digits = self.hotpConfiguration["digits"] secretKeyBase32 = self.toBase32(secretKey) otpKey = OTPKey(secretKeyBase32, OTPType.HOTP) label = issuer + ":%s" % userDisplayName; otpAuthURI = OTPAuthURIBuilder.fromKey(otpKey).label(label).issuer(issuer).digits(digits).build(); return otpAuthURI.toUriString()
def generateTotpSecretKeyUri(self, secretKey, issuer, userDisplayName): digits = self.totpConfiguration["digits"] timeStep = self.totpConfiguration["timeStep"] secretKeyBase32 = self.toBase32(secretKey) otpKey = OTPKey(secretKeyBase32, OTPType.TOTP) label = issuer + " %s" % userDisplayName otpAuthURI = OTPAuthURIBuilder.fromKey(otpKey).label(label).issuer(issuer).digits(digits).timeStep(TimeUnit.SECONDS.toMillis(timeStep)).build() return otpAuthURI.toUriString()
def generateTotpSecretKeyUri(self, secretKey, issuer, userDisplayName): digits = self.totpConfiguration["digits"] timeStep = self.totpConfiguration["timeStep"] secretKeyBase32 = self.toBase32(secretKey) otpKey = OTPKey(secretKeyBase32, OTPType.TOTP) label = issuer + ":%s" % userDisplayName; otpAuthURI = OTPAuthURIBuilder.fromKey(otpKey).label(label).issuer(issuer).digits(digits).timeStep(TimeUnit.SECONDS.toMillis(timeStep)).build(); return otpAuthURI.toUriString()