Documentation
¶
Overview ¶
Package tkeysign provides a connection to the RSA signer app running on the TKey. You're expected to pass an existing connection to it, so use it like this:
tk := tkeyclient.New() err := tk.Connect(port) signer := tkeysign.New(tk)
Then use it like this to get the public key of the TKey:
pubkey, err := signer.GetPubkey()
And like this to sign a message:
signature, err := signer.Sign(message)
Index ¶
- Constants
- type Signer
- func (s Signer) Close() error
- func (s Signer) GetAppNameVersion() (*tkeyclient.NameVersion, error)
- func (s Signer) GetFWDigest(len int) ([]byte, error)
- func (s Signer) GetIsKeyLoaded() (bool, error)
- func (s Signer) GetPubkey() ([]byte, error)
- func (s Signer) LoadKey(rsaKeyPath string) error
- func (s Signer) Sign(data []byte) ([]byte, error)
Constants ¶
View Source
const MaxSignSize = 4096
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
func New ¶
func New(tk *tkeyclient.TillitisKey) Signer
New allocates a struct for communicating with the RSA signer app running on the TKey. You're expected to pass an existing connection to it, so use it like this:
tk := tkeyclient.New() err := tk.Connect(port) signer := tk1sign.New(tk)
func (Signer) GetAppNameVersion ¶
func (s Signer) GetAppNameVersion() (*tkeyclient.NameVersion, error)
GetAppNameVersion gets the name and version of the running app in the same style as the stick itself.
func (Signer) GetFWDigest ¶
GetFWDigest asks the signer app to hash len bytes of the firmware.
It returns the resulting SHA512 digest or an error.
func (Signer) GetIsKeyLoaded ¶ added in v0.0.4
Click to show internal directories.
Click to hide internal directories.