Documentation ¶
Overview ¶
Package ecs provides functions to read, write and manipulate ECS files containing a mGuard configuration.
Index ¶
- Constants
- func GetOpensslExecutablePath() (string, error)
- func SetOpensslExecutablePath(path string) error
- type Container
- func (container *Container) Dupe() *Container
- func (container *Container) ToEncryptedFile(path string, deviceCertificate *x509.Certificate) error
- func (container *Container) ToEncryptedWriter(writer io.Writer, deviceCertificate *x509.Certificate) error
- func (container *Container) ToFile(path string) error
- func (container *Container) ToWriter(writer io.Writer) error
Constants ¶
const DefaultPassFileContent = `root\n`
DefaultPassFileContent contains the default content of the 'aca/pass' file of an ECS container.
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
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
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 ¶
ContainerFromATV wraps an ATV document in an ECS container.
func ContainerFromFile ¶
ContainerFromFile reads the specified ECS container from disk.
func ContainerFromReader ¶
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) 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.