tkeysign

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: GPL-2.0 Imports: 2 Imported by: 3

README

ci Go Reference

Tillitis TKey Sign package

A Go package for communicating with the signer device app on a Tillitis TKey to get cryptographic signatures over a message.

See the Go doc for tkeysign for details on how to call the functions.

See tkey-ssh-agent and tkey-sign-cli for client applications using this go package.

Release notes in RELEASE.md.

Licenses and SPDX tags

Unless otherwise noted, the project sources are licensed under the terms and conditions of the "GNU General Public License v2.0 only":

Copyright Tillitis AB.

These programs are free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 only.

These programs are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see:

https://www.gnu.org/licenses

See LICENSE for the full GPLv2-only license text.

External source code we have imported are isolated in their own directories. They may be released under other licenses. This is noted with a similar LICENSE file in every directory containing imported sources.

The project uses single-line references to Unique License Identifiers as defined by the Linux Foundation's SPDX project on its own source files, but not necessarily imported files. The line in each individual source file identifies the license applicable to that file.

The current set of valid, predefined SPDX identifiers can be found on the SPDX License List at:

https://spdx.org/licenses/

Documentation

Overview

Package tkeysign provides a connection to the ed25519 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

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 ed25519 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) Close

func (s Signer) Close() error

Close closes the connection to the TKey

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 added in v1.0.0

func (s Signer) GetFWDigest(len int) ([]byte, error)

GetFWDigest asks the signer app to hash len bytes of the firmware.

It returns the resulting SHA512 digest or an error.

func (Signer) GetPubkey

func (s Signer) GetPubkey() ([]byte, error)

GetPubkey fetches the public key of the signer.

func (Signer) Sign

func (s Signer) Sign(data []byte) ([]byte, error)

Sign signs the message in data and returns an ed25519 signature.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL