remote

package
v0.2102.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Package remote provides a gRPC backed signer (both client and server).

Index

Constants

View Source
const SignerName = "remote"

SignerName is the name used to identify the remote signer.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(config interface{}, roles ...signature.SignerRole) (signature.SignerFactory, error)

NewFactory creates a new factory with the specified roles.

func NewRemoteFactory

func NewRemoteFactory(ctx context.Context, conn *grpc.ClientConn) (signature.SignerFactory, error)

NewRemoteFactory creates a new gRPC remote signer client service given an existing grpc connection.

func RegisterService

func RegisterService(server *grpc.Server, signerFactory signature.SignerFactory)

RegisterService registers a new remote signer backend service with the given gRPC server.

Types

type Backend

type Backend interface {
	PublicKeys(context.Context) ([]PublicKey, error)
	Sign(context.Context, *SignRequest) ([]byte, error)
}

Backend is the remote signer backend interface.

type FactoryConfig

type FactoryConfig struct {
	// Address is the remote factory gRPC address.
	Address string
	// ServerCertificate is the server certificate.
	ServerCertificate *tls.Certificate
	// ClientCertificate is the client certificate.
	ClientCertificate *tls.Certificate
}

FactoryConfig is the remote factory configuration.

type PublicKey

type PublicKey struct {
	Role      signature.SignerRole `json:"role"`
	PublicKey signature.PublicKey  `json:"public_key"`
}

PublicKey is a public key supported by the remote signer.

type SignRequest

type SignRequest struct {
	Role    signature.SignerRole `json:"role"`
	Context string               `json:"context"`
	Message []byte               `json:"message"`
}

SignRequest is a signature request.

Jump to

Keyboard shortcuts

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