client

package
v0.0.0-...-5fd94f2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2015 License: BSD-2-Clause Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client implements the a Go client for CFSSL API commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) (*info.Resp, error)

Info sends an info request to the remote CFSSL server, receiving a response 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