Documentation
¶
Index ¶
- Constants
- Variables
- func SetCreatePolicy(policy byte) error
- type CertKit
- func (ck *CertKit) AddUserData(usrKey string, ClientCert *x509.Certificate) error
- func (ck *CertKit) Authorize(path string, parms map[string]interface{}, RemoteAddr string, ...) (httpstat int, data interface{}, err error)
- func (ck *CertKit) Delete(tree, id string) error
- func (ck *CertKit) Drop(id string) error
- func (crtkit *CertKit) GenerateCA(subject pkix.Name, host, email string, listenport ...string) error
- func (crtkit *CertKit) GenerateClient(subject pkix.Name, email, password string) ([]byte, []byte, error)
- func (crtkit *CertKit) GenerateServer(subject pkix.Name, host, email string, NotBefore ...time.Time) error
- func (ck *CertKit) GetCACert() *x509.Certificate
- func (ck *CertKit) GetCAKey() *rsa.PrivateKey
- func (ck *CertKit) GetCertPool() *x509.CertPool
- func (ck *CertKit) GetDNSNames() []string
- func (ck *CertKit) GetPending() (map[string]interface{}, error)
- func (ck *CertKit) GetServerCert() *x509.Certificate
- func (ck *CertKit) GetServerKey() *rsa.PrivateKey
- func (ck *CertKit) GetServerX509KeyPair() tls.Certificate
- func (ck *CertKit) GetTLSConfig(Access uint8) (*tls.Config, error)
- func (ck *CertKit) GetTrusted() (map[string]interface{}, error)
- func (ck *CertKit) LoadUserData() error
- func (crtkit CertKit) ReadCRL(fname string) ([]byte, error)
- func (crtkit CertKit) ReadCertFromReader(r io.Reader) (*x509.Certificate, []byte, error)
- func (crtkit CertKit) ReadCertificate(fname string) (*x509.Certificate, []byte, error)
- func (crtkit CertKit) ReadDecryptRsaPrivKey(fname string) (*rsa.PrivateKey, []byte, error)
- func (crtkit CertKit) ReadDecryptRsaPrivKeyFromReader(r io.Reader) (*rsa.PrivateKey, []byte, error)
- func (crtkit CertKit) ReadRsaPrivKey(fname string) (*rsa.PrivateKey, []byte, error)
- func (crtkit CertKit) ReadRsaPrivKeyFromReader(r io.Reader) (*rsa.PrivateKey, []byte, error)
- func (ck *CertKit) Reject(id string) error
- func (ck *CertKit) SavePending(cert *x509.Certificate) error
- func (svc CertKit) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (ck *CertKit) Setup(udata map[string]interface{}) error
- func (ck *CertKit) StartCRLServer(listenAddress string, listener *stonelizard.StoppableListener) error
- func (ck *CertKit) Trust(id string) error
- type CertkitG
Constants ¶
View Source
const ( PolicyCreateCertAsPending byte = iota PolicyCreateCertAsTrusted )
Variables ¶
View Source
var CertDirectories = []string{
"/etc/ssl/certs",
}
View Source
var ErrInvalidPolicy error = errors.New("Error invalid policy")
View Source
var ErrorCertsMustHaveKeys error = errors.New("Either provide both certificate and key or none of them")
View Source
var ErrorDuplicateFile error = errors.New("Error duplicate file")
Functions ¶
func SetCreatePolicy ¶
Types ¶
type CertKit ¶
type CertKit struct { Path string ServerCertPem, CACertPem []byte ServerCert, CACert *x509.Certificate ServerKeyPem, CAKeyPem []byte ServerKey, CAKey *rsa.PrivateKey CACRL []byte CertPool *x509.CertPool UserCerts map[string]*x509.Certificate ServerX509KeyPair tls.Certificate }
func (*CertKit) AddUserData ¶
func (ck *CertKit) AddUserData(usrKey string, ClientCert *x509.Certificate) error
func (*CertKit) GenerateCA ¶
func (*CertKit) GenerateClient ¶
func (*CertKit) GenerateServer ¶
func (*CertKit) GetCACert ¶
func (ck *CertKit) GetCACert() *x509.Certificate
func (*CertKit) GetCAKey ¶
func (ck *CertKit) GetCAKey() *rsa.PrivateKey
func (*CertKit) GetCertPool ¶
func (*CertKit) GetDNSNames ¶
func (*CertKit) GetPending ¶
func (*CertKit) GetServerCert ¶
func (ck *CertKit) GetServerCert() *x509.Certificate
func (*CertKit) GetServerKey ¶
func (ck *CertKit) GetServerKey() *rsa.PrivateKey
func (*CertKit) GetServerX509KeyPair ¶
func (ck *CertKit) GetServerX509KeyPair() tls.Certificate
func (*CertKit) GetTLSConfig ¶
func (ck *CertKit) GetTLSConfig(AuthRequired bool) (*tls.Config, error) {
func (*CertKit) GetTrusted ¶
func (*CertKit) LoadUserData ¶
func (CertKit) ReadCRL ¶
Load in memory the Certificate Revogation List from the PemPath field of Service struct
func (CertKit) ReadCertFromReader ¶
Load in memory and decodes the microservice certificate from the PemPath field of Service struct
func (CertKit) ReadCertificate ¶
Open certificate file and call the reader
func (CertKit) ReadDecryptRsaPrivKey ¶
func (CertKit) ReadDecryptRsaPrivKeyFromReader ¶
func (CertKit) ReadRsaPrivKey ¶
func (CertKit) ReadRsaPrivKeyFromReader ¶
func (*CertKit) SavePending ¶
func (ck *CertKit) SavePending(cert *x509.Certificate) error
func (*CertKit) StartCRLServer ¶
func (ck *CertKit) StartCRLServer(listenAddress string, listener *stonelizard.StoppableListener) error
Click to show internal directories.
Click to hide internal directories.