security

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The security functional block contains OCPP 2.0 features aimed at providing E2E security between a CSMS and a Charging station.

Index

Constants

View Source
const CertificateSignedFeatureName = "CertificateSigned"
View Source
const ProfileName = "security"

Variables

Functions

This section is empty.

Types

type CSMSHandler

type CSMSHandler interface {
}

Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Security profile.

type CertificateSignedFeature

type CertificateSignedFeature struct{}

During the a certificate update procedure, the CSMS sends a new certificate, signed by a CA, to the Charging Station with a CertificateSignedRequest. The Charging Station verifies the signed certificate, installs it locally and responds with a CertificateSignedResponse to the the CSMS with the status Accepted or Rejected.

func (CertificateSignedFeature) GetFeatureName

func (f CertificateSignedFeature) GetFeatureName() string

func (CertificateSignedFeature) GetRequestType

func (f CertificateSignedFeature) GetRequestType() reflect.Type

func (CertificateSignedFeature) GetResponseType

func (f CertificateSignedFeature) GetResponseType() reflect.Type

type CertificateSignedRequest

type CertificateSignedRequest struct {
	Cert              []string                    `json:"cert" validate:"required,min=1,dive,max=800"`
	TypeOfCertificate types.CertificateSigningUse `json:"typeOfCertificate,omitempty" validate:"omitempty,certificateSigningUse"`
}

The field definition of the CertificateSignedRequest PDU sent by the CSMS to the Charging Station.

func NewCertificateSignedRequest

func NewCertificateSignedRequest(certificate []string) *CertificateSignedRequest

Creates a new CertificateSignedRequest, containing all required fields. Additional optional fields may be set afterwards.

func (CertificateSignedRequest) GetFeatureName

func (r CertificateSignedRequest) GetFeatureName() string

type CertificateSignedResponse

type CertificateSignedResponse struct {
	Status CertificateSignedStatus `json:"status" validate:"required,certificateSignedStatus"`
}

The field definition of the CertificateSignedResponse payload sent by the Charging Station to the CSMS in response to a CertificateSignedRequest.

func NewCertificateSignedResponse

func NewCertificateSignedResponse(status CertificateSignedStatus) *CertificateSignedResponse

Creates a new CertificateSignedResponse, containing all required fields. There are no optional fields for this message.

func (CertificateSignedResponse) GetFeatureName

func (c CertificateSignedResponse) GetFeatureName() string

type CertificateSignedStatus

type CertificateSignedStatus string

Status returned in response to CertificateSignedRequest, that indicates whether certificate signing has been accepted or rejected.

const (
	CertificateSignedStatusAccepted CertificateSignedStatus = "Accepted"
	CertificateSignedStatusRejected CertificateSignedStatus = "Rejected"
)

type ChargingStationHandler

type ChargingStationHandler interface {
	// OnCertificateSigned is called on a charging station whenever a CertificateSignedRequest is received from the CSMS.
	OnCertificateSigned(request *CertificateSignedRequest) (response *CertificateSignedResponse, err error)
}

Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Security profile.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL