client

package
v0.0.0-...-566f305 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2015 License: MIT, BSD-2-Clause Imports: 11 Imported by: 1

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 Response

type Response struct {
	Success  bool              `json:"success"`
	Result   interface{}       `json:"result"`
	Errors   []ResponseMessage `json:"errors"`
	Messages []ResponseMessage `json:"messages"`
}

Response implements the CloudFlare standard for API responses. CFSSL does not currently use the messages field, but it is provided for compatability.

type ResponseMessage

type ResponseMessage struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ResponseMessage implements the standard for response errors and messages. A message has a code and a string message.

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