client

package
v0.0.0-...-b7f9050 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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(hostname string, port string, tlsConfig *tls.Config) *NotarySigner

NewNotarySigner is a convenience method that returns NotarySigner

func (*NotarySigner) AddKey

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

AddKey adds a key

func (*NotarySigner) CheckHealth

func (trust *NotarySigner) CheckHealth(timeout time.Duration) error

CheckHealth checks the health of one of the clients, since both clients run from the same GRPC server.

func (*NotarySigner) Create

func (trust *NotarySigner) Create(role, 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, string, 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]string

ListAllKeys not supported for NotarySigner

func (*NotarySigner) ListKeys

func (trust *NotarySigner) ListKeys(role string) []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