Documentation ¶
Index ¶
Constants ¶
const DefaultLeeway = 1 * time.Minute
DefaultLeeway is the duration for matching not before claims.
Variables ¶
var DefaultsFile = filepath.Join(config.StepPath(), "config", "defaults.json")
DefaultsFile contains the location of the defaults file.
var IdentityFile = filepath.Join(config.StepPath(), "config", "identity.json")
IdentityFile contains the location of the identity file.
Functions ¶
func WriteDefaultIdentity ¶
func WriteDefaultIdentity(certChain []api.Certificate, key crypto.PrivateKey) error
WriteDefaultIdentity writes the given certificates and key and the identity.json pointing to the new files.
func WriteIdentityCertificate ¶
func WriteIdentityCertificate(certChain []api.Certificate) error
WriteIdentityCertificate writes the identity certificate in disk.
Types ¶
type Client ¶
Client wraps http.Client with a transport using the step root and identity.
func LoadClient ¶
LoadClient configures an http.Client with the root in $STEPPATH/config/defaults.json and the identity defined in $STEPPATH/config/identity.json
type Identity ¶
type Identity struct { Type string `json:"type"` Certificate string `json:"crt"` Key string `json:"key"` }
Identity represents the identity file that can be used to authenticate with the CA.
func LoadDefaultIdentity ¶
LoadDefaultIdentity loads the default identity.
func (*Identity) GetClientCertificateFunc ¶
func (i *Identity) GetClientCertificateFunc() func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
GetClientCertificateFunc returns a method that can be used as the GetClientCertificate property in a tls.Config.
func (*Identity) Renew ¶
Renew renews the current identity certificate using a client with a renew method.
func (*Identity) TLSCertificate ¶
func (i *Identity) TLSCertificate() (tls.Certificate, error)
TLSCertificate returns a tls.Certificate for the identity.
type Renewer ¶
type Renewer interface { GetRootCAs() *x509.CertPool Renew(tr http.RoundTripper) (*api.SignResponse, error) }
Renewer is that interface that a renew client must implement.