ocfclient

package
v0.0.0-...-5336895 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Timeout = time.Second * 10

Variables

View Source
var (
	CertIdentity = "00000000-0000-0000-0000-000000000001"

	MfgCert         = []byte{}
	MfgKey          = []byte{}
	MfgTrustedCA    = []byte{}
	MfgTrustedCAKey = []byte{}

	IdentityTrustedCA         = []byte{}
	IdentityTrustedCAKey      = []byte{}
	IdentityIntermediateCA    = []byte{}
	IdentityIntermediateCAKey = []byte{}
	IdentityCert              = []byte{}
	IdentityKey               = []byte{}
)

Functions

func NewSecureClient

func NewSecureClient() (*local.Client, error)

func ReadCommandOptions

func ReadCommandOptions(opts Options.Options)

func WriteCertOut

func WriteCertOut(filename string, cert []byte) error

func WritePrivateKey

func WritePrivateKey(filename string, priv *ecdsa.PrivateKey) error

Types

type OCFClient

type OCFClient struct {
	// contains filtered or unexported fields
}

OCFClient is an OCF Client for working with devices

func (*OCFClient) Close

func (c *OCFClient) Close() error

func (*OCFClient) Discover

func (c *OCFClient) Discover(discoveryTimeout time.Duration) (string, error)

Discover devices in the local area

func (*OCFClient) DisownDevice

func (c *OCFClient) DisownDevice(deviceID string) error

DisownDevice removes the current ownership

func (*OCFClient) GetResource

func (c *OCFClient) GetResource(deviceID, href string) (string, error)

GetResource returns info of the resource at the given href of the device

func (*OCFClient) GetResources

func (c *OCFClient) GetResources(deviceID string) (string, error)

GetResources returns all resources info of the device

func (*OCFClient) Initialize

func (c *OCFClient) Initialize() error

Initialize creates and initializes new local client

func (*OCFClient) OwnDevice

func (c *OCFClient) OwnDevice(deviceID string) (string, error)

OwnDevice transfers the ownership of the device to user represented by the token

func (*OCFClient) UpdateResource

func (c *OCFClient) UpdateResource(deviceID string, href string, data interface{}) error

UpdateResource updates a resource of the device

type SetupSecureClient

type SetupSecureClient struct {
	// contains filtered or unexported fields
}

func (*SetupSecureClient) GetManufacturerCertificate

func (c *SetupSecureClient) GetManufacturerCertificate() (tls.Certificate, error)

func (*SetupSecureClient) GetManufacturerCertificateAuthorities

func (c *SetupSecureClient) GetManufacturerCertificateAuthorities() ([]*x509.Certificate, error)

func (*SetupSecureClient) GetRootCertificateAuthorities

func (c *SetupSecureClient) GetRootCertificateAuthorities() ([]*x509.Certificate, error)

Jump to

Keyboard shortcuts

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