client

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCConnection added in v0.4.0

func NewGRPCConnection(hostname string, port string, tlsConfig *tls.Config) (*grpc.ClientConn, error)

NewGRPCConnection is a convenience method that returns GRPC Client Connection given a hostname, endpoint, and TLS options

Types

type NotarySigner

type NotarySigner struct {
	// contains filtered or unexported fields
}

NotarySigner implements a RPC based Trust service that calls the Notary-signer Service

func NewNotarySigner

func NewNotarySigner(conn *grpc.ClientConn) *NotarySigner

NewNotarySigner is a convenience method that returns NotarySigner given a GRPC connection

func (*NotarySigner) AddKey added in v0.3.0

func (trust *NotarySigner) AddKey(role data.RoleName, gun data.GUN, k data.PrivateKey) error

AddKey adds a key

func (*NotarySigner) CheckHealth

func (trust *NotarySigner) CheckHealth(d time.Duration, serviceName string) error

CheckHealth are used to probe whether the server is able to handle rpcs.

func (*NotarySigner) Create

func (trust *NotarySigner) Create(role data.RoleName, gun data.GUN, algorithm string) (data.PublicKey, error)

Create creates a remote key and returns the PublicKey associated with the remote private key

func (*NotarySigner) GetKey

func (trust *NotarySigner) GetKey(keyid string) data.PublicKey

GetKey retrieves a key by ID - returns nil if the key doesn't exist

func (*NotarySigner) GetPrivateKey

func (trust *NotarySigner) GetPrivateKey(keyid string) (data.PrivateKey, data.RoleName, error)

GetPrivateKey retrieves by ID an object that can be used to sign, but that does not contain any private bytes. If the key doesn't exist, returns an error.

func (*NotarySigner) ListAllKeys

func (trust *NotarySigner) ListAllKeys() map[string]data.RoleName

ListAllKeys not supported for NotarySigner

func (*NotarySigner) ListKeys

func (trust *NotarySigner) ListKeys(role data.RoleName) []string

ListKeys not supported for NotarySigner

func (*NotarySigner) RemoveKey

func (trust *NotarySigner) RemoveKey(keyid string) error

RemoveKey deletes a key by ID - if the key didn't exist, succeed anyway

type RemotePrivateKey

type RemotePrivateKey struct {
	data.PublicKey
	// contains filtered or unexported fields
}

RemotePrivateKey is a key that is on a remote service, so no private key bytes are available

func NewRemotePrivateKey

func NewRemotePrivateKey(pubKey data.PublicKey, sClient pb.SignerClient) *RemotePrivateKey

NewRemotePrivateKey returns RemotePrivateKey, a data.PrivateKey that is only good for signing. (You can't get the private bytes out for instance.)

func (*RemotePrivateKey) CryptoSigner

func (pk *RemotePrivateKey) CryptoSigner() crypto.Signer

CryptoSigner returns a crypto.Signer tha wraps the RemotePrivateKey. Needed for implementing the interface.

func (*RemotePrivateKey) Private

func (pk *RemotePrivateKey) Private() []byte

Private returns nil bytes

func (*RemotePrivateKey) Sign

func (pk *RemotePrivateKey) Sign(rand io.Reader, msg []byte,
	opts crypto.SignerOpts) ([]byte, error)

Sign calls a remote service to sign a message.

func (*RemotePrivateKey) SignatureAlgorithm

func (pk *RemotePrivateKey) SignatureAlgorithm() data.SigAlgorithm

SignatureAlgorithm returns the signing algorithm based on the type of PublicKey algorithm.

type RemoteSigner

type RemoteSigner struct {
	RemotePrivateKey
}

RemoteSigner wraps a RemotePrivateKey and implements the crypto.Signer interface

func (*RemoteSigner) Public

func (rs *RemoteSigner) Public() crypto.PublicKey

Public method of a crypto.Signer needs to return a crypto public key.

Jump to

Keyboard shortcuts

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