signer

package
v0.0.0-...-f9ba299 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2014 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Overview

Package signer implements certificate signature functionality for CF-SSL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSigAlgo

func DefaultSigAlgo(priv interface{}) x509.SignatureAlgorithm

DefaultSigAlgo returns an appropriate X.509 signature algorithm given the CA's private key.

Types

type Signer

type Signer struct {
	CA      *x509.Certificate
	Priv    interface{}
	Policy  *config.Signing
	SigAlgo x509.SignatureAlgorithm
}

A Signer contains a CA's certificate and private key for signing certificates, a Signing policy to refer to and a SignatureAlgorithm

func NewSigner

func NewSigner(caFile, cakeyFile string, policy *config.Signing) (*Signer, error)

NewSigner generates a new certificate signer using the certificate authority certificate and private key and Signing config for signing. caFile should contain the CA's certificate, and the cakeyFile should contain the private key. Both must be PEM-encoded.

func (*Signer) Sign

func (s *Signer) Sign(hostName string, in []byte, profileName string) (cert []byte, err error)

Sign signs a new certificate based on the PEM-encoded client certificate or certificate request with the signing profile, specified by profileName. The certificate will be valid for the host named in the hostName parameter.

Jump to

Keyboard shortcuts

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