httpsnapservice

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2018 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PeerConfigPath = ""

PeerConfigPath use for testing

Functions

func NewCertPoolCache added in v0.2.0

func NewCertPoolCache() *lazycache.Cache

NewCertPoolCache a cache of cert pool instances It is expected to only have two values: one with system cert pool enabled and another with it disabled This allows dynamic configuration to toggle this setting

Types

type CertPoolCacheKey added in v0.2.0

type CertPoolCacheKey interface {
	lazycache.Key
	UseSystemPool() bool
}

CertPoolCacheKey channel config reference cache key

func NewCertPoolCacheKey added in v0.2.0

func NewCertPoolCacheKey(useSystemPool bool) CertPoolCacheKey

NewCertPoolCacheKey returns a new CacheKey

type Dialer

type Dialer func(network, addr string) (net.Conn, error)

Dialer is custom dialer to verify cert against pinset

type HTTPServiceImpl

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

HTTPServiceImpl used to create transaction service

func Get

func Get(channelID string) (*HTTPServiceImpl, error)

Get will return httpService to caller

func (*HTTPServiceImpl) GeneratePin

func (httpServiceImpl *HTTPServiceImpl) GeneratePin(c *x509.Certificate) string

GeneratePin returns pin of an x509 certificate

func (*HTTPServiceImpl) Invoke

func (httpServiceImpl *HTTPServiceImpl) Invoke(httpServiceInvokeRequest HTTPServiceInvokeRequest) ([]byte, error)

Invoke http service

type HTTPServiceInvokeRequest

type HTTPServiceInvokeRequest struct {
	RequestURL     string
	RequestHeaders map[string]string
	RequestBody    string
	NamedClient    string
	PinSet         []string
}

HTTPServiceInvokeRequest used to create http invoke service

type PrivateKey

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

PrivateKey is signer implementation for golang client TLS

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

Public returns the public key corresponding to priv.

func (*PrivateKey) Sign

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

Sign signs msg with priv, reading randomness from rand. If opts is a *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will be used. This method is intended to support keys where the private part is kept in, for example, a hardware module. Common uses should use the Sign* functions in this package.

Jump to

Keyboard shortcuts

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