client

package
v0.0.0-...-0692a52 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2015 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoReq

type InfoReq struct {
	Label   string `json:"label"`
	Profile string `json:"profile"`
}

InfoReq is the request struct for an info API request.

type InfoResp

type InfoResp struct {
	Certificate string `json:"certificate"`
}

InfoResp is the response for an Info API request.

type Server

type Server struct {
	Address string
	Port    int
}

A Server points to a remote CFSSL instance.

func NewServer

func NewServer(addr string) *Server

NewServer sets up a new server target. The address should be the DNS name (or "name:port") of the remote CFSSL instance. If no port is specified, the CFSSL default port (8888) is used.

func (*Server) AuthInfo

func (srv *Server) AuthInfo(req, id []byte, provider auth.Provider) ([]byte, error)

AuthInfo fills out an authenticated info request to the server, receiving a certificate or error in response. It takes the serialized JSON request to send, remote address and authentication provider.

func (*Server) AuthReq

func (srv *Server) AuthReq(req, ID []byte, provider auth.Provider, target string) ([]byte, error)

AuthReq is the common logic for AuthSign and AuthInfo -- perform the given request, and return the resultant certificate. The target is either 'sign' or 'info'.

func (*Server) AuthSign

func (srv *Server) AuthSign(req, id []byte, provider auth.Provider) ([]byte, error)

AuthSign fills out an authenticated signing request to the server, receiving a certificate or error in response. It takes the serialized JSON request to send, remote address and authentication provider.

func (*Server) Info

func (srv *Server) Info(jsonData []byte) ([]byte, error)

Info sends an info request to the remote CFSSL server, receiving a certificate or an error in response. It takes the serialized JSON request to send.

func (*Server) Req

func (srv *Server) Req(jsonData []byte, target string) ([]byte, error)

Req performs the common logic for Sign and Info, performing the actual request and returning the resultant certificate.

func (*Server) Sign

func (srv *Server) Sign(jsonData []byte) ([]byte, error)

Sign sends a signature request to the remote CFSSL server, receiving a signed certificate or an error in response. It takes the serialized JSON request to send.

type SignResult

type SignResult struct {
	Certificate []byte `json:"certificate"`
}

SignResult is the result of signing a CSR.

Jump to

Keyboard shortcuts

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