Documentation ¶
Index ¶
- type SelfSignedCertsService
- func (svc *SelfSignedCertsService) CreateDeviceCert(ctx hubclient.ServiceContext, args certsapi.CreateDeviceCertArgs) (certsapi.CreateCertResp, error)
- func (svc *SelfSignedCertsService) CreateServiceCert(ctx hubclient.ServiceContext, args certsapi.CreateServiceCertArgs) (certsapi.CreateCertResp, error)
- func (svc *SelfSignedCertsService) CreateUserCert(ctx hubclient.ServiceContext, args certsapi.CreateUserCertArgs) (certsapi.CreateCertResp, error)
- func (svc *SelfSignedCertsService) Start() (err error)
- func (svc *SelfSignedCertsService) Stop() error
- func (svc *SelfSignedCertsService) VerifyCert(ctx hubclient.ServiceContext, args certsapi.VerifyCertArgs) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SelfSignedCertsService ¶
type SelfSignedCertsService struct {
// contains filtered or unexported fields
}
SelfSignedCertsService creates certificates for use by services, devices and admin users.
This implements the ICertsService interface ¶
Note that this service does not support certificate revocation.
See also: https://www.imperialviolet.org/2014/04/19/revchecking.html
Issued certificates are short-lived and must be renewed before they expire.
func NewSelfSignedCertsService ¶
func NewSelfSignedCertsService( caCert *x509.Certificate, caKey *ecdsa.PrivateKey, hc *hubclient.HubClient, ) *SelfSignedCertsService
NewSelfSignedCertsService returns a new instance of the selfsigned certificate service
caCert is the CA certificate used to created certificates caKey is the CA private key used to created certificates hc is the connection to the hub with a service role. For testing it can be nil.
func (*SelfSignedCertsService) CreateDeviceCert ¶
func (svc *SelfSignedCertsService) CreateDeviceCert( ctx hubclient.ServiceContext, args certsapi.CreateDeviceCertArgs) (certsapi.CreateCertResp, error)
CreateDeviceCert creates a CA signed certificate for mutual authentication by IoT devices in PEM format
func (*SelfSignedCertsService) CreateServiceCert ¶
func (svc *SelfSignedCertsService) CreateServiceCert( ctx hubclient.ServiceContext, args certsapi.CreateServiceCertArgs) (certsapi.CreateCertResp, error)
CreateServiceCert creates a CA signed service certificate for mutual authentication between services
func (*SelfSignedCertsService) CreateUserCert ¶
func (svc *SelfSignedCertsService) CreateUserCert( ctx hubclient.ServiceContext, args certsapi.CreateUserCertArgs) (certsapi.CreateCertResp, error)
CreateUserCert creates a client certificate for end-users
func (*SelfSignedCertsService) Start ¶
func (svc *SelfSignedCertsService) Start() (err error)
Start the service and listen for requests
func (*SelfSignedCertsService) Stop ¶
func (svc *SelfSignedCertsService) Stop() error
Stop the service and remove subscription
func (*SelfSignedCertsService) VerifyCert ¶
func (svc *SelfSignedCertsService) VerifyCert(ctx hubclient.ServiceContext, args certsapi.VerifyCertArgs) error
VerifyCert verifies whether the given certificate is a valid client certificate