func OtpGenerate(info *vault.AccountInfo, otpSite *string) {
	// Get
	keys, err := net.LookupTXT("_otp." + *otpSite)
	if err != nil {
		logrus.Fatal(err)
	}

	for _, txt := range keys {
		key, err := bmcrypto.PublicKeyFromString(txt)
		if err == nil {
			if !key.Type.CanKeyExchange() {
				continue
			}

			// Generate secret on the client and compute OTP
			secret, err := bmcrypto.KeyExchange(info.GetActiveKey().PrivKey, *key)
			if err != nil {
				logrus.Fatal(err)
			}

			printOtpLoop(secret, *otpSite)

			return
		}
	}

	logrus.Fatal(fmt.Errorf("The site does not support OTP authentication: " + *otpSite))
}
// OtpGenerate will generate an OTP valid for otpSite
OtpGenerate will generate an OTP valid for otpSite
// OtpGenerate will generate an OTP valid for otpSite
func OtpGenerate(info *vault.AccountInfo, otpSite *string) {
	keys, err := net.LookupTXT("_otp." + *otpSite)
	if err != nil {
		logrus.Fatal(err)
	}
	for _, txt := range keys {
		key, err := bmcrypto.PublicKeyFromString(txt)
		if err == nil {
			if !key.Type.CanKeyExchange() {
				continue
			}
			secret, err := bmcrypto.KeyExchange(info.GetActiveKey().PrivKey, *key)
			if err != nil {
				logrus.Fatal(err)
			}
			printOtpLoop(secret, *otpSite)
			return
		}
	}
	logrus.Fatal(fmt.Errorf("The site does not support OTP authentication: " + *otpSite))
}
func OtpGenerate ( info * vault . AccountInfo , otpSite * string ) { keys , err := net . LookupTXT ( " " + * otpSite ) if err != nil { logrus . Fatal ( err ) } for _ , txt := range keys { key , err := bmcrypto . PublicKeyFromString ( txt ) if err == nil { if ! key . Type . CanKeyExchange ( ) { continue } secret , err := bmcrypto . KeyExchange ( info . GetActiveKey ( ) . PrivKey , * key ) if err != nil { logrus . Fatal ( err ) } printOtpLoop ( secret , * otpSite ) return } } logrus . Fatal ( fmt . Errorf ( " " + * otpSite ) ) }
OtpGenerate will generate an OTP valid for otpSite
OtpGenerate will generate an OTP valid for otpSite
// Get // Generate secret on the client and compute OTP