ecs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

Package ecs provides functions to read, write and manipulate ECS files containing a mGuard configuration.

Index

Constants

View Source
const DefaultPassFileContent = `root\n`

DefaultPassFileContent contains the default content of the 'aca/pass' file of an ECS container.

View Source
const DefaultSnmpdFileContent = `createUser "admin" MD5 "SnmpAdmin" DES "SnmpAdmin"\n`

DefaultSnmpdFileContent contains the default content of the 'aca/snmpd' file of an ECS container.

Variables

This section is empty.

Functions

func GetOpensslExecutablePath added in v0.5.0

func GetOpensslExecutablePath() (string, error)

GetOpensslExecutablePath returns the absolute path to the openssl executable. If SetOpensslExecutablePath was called, it simply returns the set path. If SetOpensslExecutablePath was not called, it tries to find the executable using the PATH variable.

func SetOpensslExecutablePath added in v0.5.0

func SetOpensslExecutablePath(path string) error

SetOpensslExecutablePath explicitly sets the path to the openssl executable. Specify an empty string to enable searching for it using the PATH variable.

Types

type Container

type Container struct {
	Atv   *atv.File
	Users *shadow.File
	// contains filtered or unexported fields
}

Container represents a mGuard ECS container.

func ContainerFromATV

func ContainerFromATV(atv *atv.File) *Container

ContainerFromATV wraps an ATV document in an ECS container.

func ContainerFromFile

func ContainerFromFile(path string) (*Container, error)

ContainerFromFile reads the specified ECS container from disk.

func ContainerFromReader

func ContainerFromReader(reader io.Reader) (*Container, error)

ContainerFromReader reads an ECS container from the specified io.Reader.

func NewContainer

func NewContainer() *Container

NewContainer returns a new and empty ECS container.

func (*Container) Dupe

func (container *Container) Dupe() *Container

Dupe returns a copy of the ECS container.

func (*Container) ToEncryptedFile added in v0.5.0

func (container *Container) ToEncryptedFile(path string, deviceCertificate *x509.Certificate) error

ToEncryptedFile writes the ECS container encrypted with the specified device certificate to the specified file.

func (*Container) ToEncryptedWriter added in v0.5.0

func (container *Container) ToEncryptedWriter(writer io.Writer, deviceCertificate *x509.Certificate) error

ToEncryptedWriter writes the ECS container encrypted with the specified device certificate to the specified io.Writer.

func (*Container) ToFile

func (container *Container) ToFile(path string) error

ToFile saves the ECS container to the specified file.

func (*Container) ToWriter

func (container *Container) ToWriter(writer io.Writer) error

ToWriter writes the ECS container to the specified io.Writer.

Jump to

Keyboard shortcuts

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