      
      */
     func updateOtpToken() {
+        // get otpauth, if we are able to generate a token, return
+        if var otpauthString = getAdditionValue(withKey: "otpauth") {
+            if !otpauthString.hasPrefix("otpauth:") {
+                otpauthString = "otpauth:\(otpauthString)"
+            }
+            if let otpauthUrl = URL(string: otpauthString),
+                let token = Token(url: otpauthUrl) {
+                self.otpToken = token
+                return
+            }
+        }
+        
         // get secret data
         guard let secretString = getAdditionValue(withKey: "otp_secret"),
             let secretData = MF_Base32Codec.data(fromBase32String: secretString),

        if let algoString = getAdditionValue(withKey: "otp_algorithm") {
            switch algoString.lowercased() {
                case "sha256":
                    algorithm = Generator.Algorithm.sha256
                case "sha512":
                    algorithm = Generator.Algorithm.sha512
                default:
                    algorithm = Generator.Algorithm.sha1
            }
        }
    

}

class Password {
    static let otpKeywords = ["otp_secret", "otp_type", "otp_algorithm", "otp_period", "otp_digits", "otp_counter", "otpauth"]
    
    var name = ""
    var password = ""
