Documentation ¶
Overview ¶
Package remote provides a gRPC backed signer (both client and server).
Index ¶
- Constants
- func NewFactory(config interface{}, roles ...signature.SignerRole) (signature.SignerFactory, error)
- func NewRemoteFactory(ctx context.Context, conn *grpc.ClientConn) (signature.SignerFactory, error)
- func RegisterService(server *grpc.Server, signerFactory signature.SignerFactory)
- type Backend
- type FactoryConfig
- type ProveRequest
- type PublicKey
- type SignRequest
Constants ¶
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) Prove(context.Context, *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.