Documentation ¶
Index ¶
- Constants
- func CleanupWorkspace() error
- func LoadWorkspace() (*State, *Spec, error)
- func NewWorkspace(state *State, spec *Spec) error
- func SaveSpec(spec *Spec, file string) error
- func SaveState(state *State, file string) error
- func SaveWorkspace(state *State, spec *Spec) error
- type Cert
- type Claim
- type Config
- type Manager
- type Metadata
- type Policy
- type Spec
- type State
- type TrustFunc
Constants ¶
View Source
const ( // CertTypeRoot represents a root certificate authority CertTypeRoot = 1 + iota // CertTypeInterm represents an intermediate certificate authority CertTypeInterm // CertTypeServer represents a server certificate CertTypeServer // CertTypeClient represents a client certificate CertTypeClient )
View Source
const ( // DirRoot is the name of directory for root certificate authority DirRoot = "root" // DirInterm is the name of directory for intermediate certificate authorities DirInterm = "intermediate" // DirServer is the name of directory for server certificates DirServer = "server" // DirClient is the name of directory for client certificates DirClient = "client" // DirCSR is the name of directory for certificate signing requests DirCSR = "csr" // FileState is the name of state file FileState = "state.yaml" // FileSpec is the name of spec file FileSpec = "spec.toml" )
Variables ¶
This section is empty.
Functions ¶
func CleanupWorkspace ¶
func CleanupWorkspace() error
CleanupWorkspace removes all directories and files in a workspace
func LoadWorkspace ¶
LoadWorkspace loads an existing workspace
func NewWorkspace ¶
NewWorkspace creates a new workspace in current directory
func SaveWorkspace ¶
SaveWorkspace saves changes to an existing workspace
Types ¶
type Cert ¶ added in v0.1.2
Cert represents the type for a certificate
type Claim ¶
type Claim struct { CommonName string `toml:"-"` Country []string `toml:"country"` Province []string `toml:"province"` Locality []string `toml:"locality"` Organization []string `toml:"organization"` OrganizationalUnit []string `toml:"organizational_unit"` DNSName []string `toml:"dns_name"` IPAddress []net.IP `toml:"ip_address"` EmailAddress []string `toml:"email_address"` StreetAddress []string `toml:"street_address"` PostalCode []string `toml:"postal_code"` }
Claim represents the subtype for an identity claim
type Config ¶
type Config struct { Serial int64 `yaml:"serial"` Length int `yaml:"length"` Days int `yaml:"days"` Password string `yaml:"-" secret:"required,6"` }
Config represents the subtype for configurations
type Manager ¶
type Manager interface { GenCert(Config, Claim, Cert) error GenCSR(Config, Claim, Cert) error SignCSR(Config, Cert, Config, Cert, TrustFunc) error VerifyCert(Cert, Cert, string) error }
Manager provides methods for managing certificates
type Policy ¶
type Policy struct { Match []string `toml:"match"` Supplied []string `toml:"supplied" default:"CommonName"` }
Policy represents the subtype for a policy
type Spec ¶
type Spec struct { Root Claim `toml:"root"` Interm Claim `toml:"intermediate"` Server Claim `toml:"server"` Client Claim `toml:"client"` RootPolicy Policy `toml:"root_policy"` IntermPolicy Policy `toml:"intermediate_policy"` Metadata Metadata `toml:"metadata"` }
Spec represents the type for specs
type State ¶
type State struct { Root Config `yaml:"root"` Interm Config `yaml:"intermediate"` Server Config `yaml:"server"` Client Config `yaml:"client"` }
State represents the type for state
type TrustFunc ¶
type TrustFunc func(*x509.Certificate, *x509.CertificateRequest) bool
TrustFunc is the function for determing if a ca can sign a csr
func PolicyTrustFunc ¶
PolicyTrustFunc returns a TrustFunc using Policy
Click to show internal directories.
Click to hide internal directories.