Skip to content

Package pinentry provides a client to GnuPG's pinentry.

License

Notifications You must be signed in to change notification settings

AccumulateNetwork/go-pinentry

 
 

Repository files navigation

go-pinentry

PkgGoDev

Package pinentry provides a client to GnuPG's pinentry.

Key Features

  • Support for all pinentry features.
  • Idiomatic Go API.
  • Well tested.

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)
	}

Comparison with related packages

Compared to github.com/gopasspw/pinentry, this package:

  • Implements all pinentry features.
  • Includes tests.
  • Implements a full parser of the underlying Assuan protocol for better compatibility with all pinentry implementations.

License

MIT

About

Package pinentry provides a client to GnuPG's pinentry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%