A library for running a GnuPG pinentry process and communicating it with the Assuan client protocol.
A class for running pinentry programs.
Example:
var Pinentry = require("pinentry");
new Pinentry().connect().getPin({desc: "gimme pin"}, function (err, pin) {
if (err) console.log("error");
else console.log("got pin", pin);
this.close();
});
For more detailed usage, see example.js
.
Create a new pinentry object.
Run the given pinentry command and connect to it. cmd defaults to "pinentry". If a callback is provided, it is called when the connection is established, with an error if there is an error. If a connection error occurs but there is no callback, an error is event is emitted on the pinentry object instead.
Prompt the user to confirm something. If user chooses OK, callback is called with null arguments). If user chooses Cancel, callback is called with a PinentryOperationCancelledError object.
Show a message to the user.
Ask the user to enter a pin. The callback is called with an error object if there is an error, and a pin if the user enters a pin.
Emitted on error response for setting properties. Note that an error for a confirm/message/getPin call itself is put in the callback instead of an event.
Use these parameters for the confirm
, message
, and getPin
methods.
desc
: Description textprompt
: Heading texttitle
: Window title textok
: OK button textcancel
: Cancel button texterror
: Additional textOther options (unknown use or not working):
keyinfo
, repeat
, repeaterror
, notok
, timeout
, qualitybar
,
qualitybar_tt
Pinentry.OperationCancelledError
Error object returned to callbacks when user cancels a prompt.
Pinentry.Error
Generic error object returned to callbacks.
Fair License (Fair)
© 2015 Charles Lehner
Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.