Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

A version of github.com/twpayne/go-pinentry with minimal dependencies.

License

Notifications You must be signed in to change notification settings

twpayne/go-pinentry-minimal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-pinentry-minimal

PkgGoDev

Package pinentry provides a minimal client to GnuPG's pinentry, which only depends on Go's standard library. It is a fork of github.com/twpayne/go-pinentry.

Key Features

  • Support for all pinentry features.
  • Idiomatic Go API.
  • Forked from a well-tested library.

Example

	client, err := pinentry.NewClient(
		pinentry.WithBinaryNameFromGnuPGAgentConf(),
		pinentry.WithDesc("My description"),
		pinentry.WithGPGTTY(),
		pinentry.WithPrompt("My prompt:"),
		pinentry.WithTitle("My title")
	)
	if err != nil {
		return err
	}
	defer client.Close()

	switch pin, fromCache, err := client.GetPIN(); {
	case pinentry.IsCancelled(err):
		fmt.Println("Cancelled")
	case err != nil:
		return err
	case fromCache:
		fmt.Printf("PIN: %s (from cache)\n", pin)
	default:
		fmt.Printf("PIN: %s\n", pin)
	}

License

MIT

About

A version of github.com/twpayne/go-pinentry with minimal dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages