Documentation ¶
Index ¶
- type Service
- func (s *Service) CACreate(ctx context.Context, request client.APICertificateRequest) (string, []byte, []byte, error)
- func (s *Service) CAGet(collection string) (*manager.CA, error)
- func (s *Service) CertificateDelete(ctx context.Context, collection, cn string) (ok bool, err error)
- func (s *Service) CertificateGet(ctx context.Context, collection, id string, remaining int) (client.Certificate, error)
- func (s *Service) CertificateList(ctx context.Context, collection string) (certificates map[string]client.Certificate, err error)
- func (s *Service) CertificateSet(ctx context.Context, collection string, request client.APICertificateRequest) ([]byte, []byte, []byte, error)
- func (s *Service) Close() error
- func (s *Service) IsNearToExpire(certificate client.Certificate, percent int) bool
- func (s *Service) Server() bool
- func (s *Service) Status() (status client.APIStatus, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the struct used for every request
func NewAsClient ¶
NewAsClient creates a Server instance that requires a remote server to operate
func NewAsServer ¶
NewAsServer creates a Service instance that handles the store directly
func (*Service) CACreate ¶
func (s *Service) CACreate(ctx context.Context, request client.APICertificateRequest) (string, []byte, []byte, error)
CACreate is responsible of create a new CA struct with its certificate returning its information
func (*Service) CertificateDelete ¶
func (s *Service) CertificateDelete(ctx context.Context, collection, cn string) (ok bool, err error)
CertificateDelete removes the certificate from the store
func (*Service) CertificateGet ¶
func (s *Service) CertificateGet(ctx context.Context, collection, id string, remaining int) (client.Certificate, error)
CertificateGet returns the certificate and its key information
func (*Service) CertificateList ¶
func (s *Service) CertificateList(ctx context.Context, collection string) (certificates map[string]client.Certificate, err error)
CertificateList returns an array of certificates and its x509 representation
func (*Service) CertificateSet ¶
func (s *Service) CertificateSet(ctx context.Context, collection string, request client.APICertificateRequest) ([]byte, []byte, []byte, error)
CertificateSet creates a new certificate and stores in the store (if server) or POST to the API
func (*Service) IsNearToExpire ¶
func (s *Service) IsNearToExpire(certificate client.Certificate, percent int) bool
IsNearToExpire returns true if certificate is already expired or remaining days are less than (percent/100)