remote

package
v0.2403.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 10 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{}) (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() ([]PublicKey, error)
	Sign(*SignRequest) ([]byte, error)
	Prove(*ProveRequest) ([]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.

func (*FactoryConfig) IsLocal added in v0.2201.8

func (fc *FactoryConfig) IsLocal() bool

IsLocal returns true iff the configured endpoint is over AF_LOCAL.

type ProveRequest added in v0.2200.0

type ProveRequest struct {
	Role  signature.SignerRole `json:"role"`
	Alpha []byte               `json:"alpha"`
}

ProveRequest is a VRF proof request.

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