config

package
v0.0.2-0...-0d7cfed Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CEST_ENCRYPTION_INVALID = iota
	CEST_ENCRYPTION_AES128
	CEST_ENCRYPTION_AES256
)

Enum Definitions

View Source
const (
	CEST_STR_ENCRYPTION_AES128 = "aes128"
	CEST_STR_ENCRYPTION_AES256 = "aes256"
)
View Source
const (
	CEST_MODE_INVALID = iota
	CEST_MODE_CBC
	CEST_MODE_GCM
)
View Source
const (
	CEST_STR_ENC_MODE_CBC = "cbc"
	CEST_STR_ENC_MODE_GCM = "gcm"
)
View Source
const (
	CEST_HASH_INVALID = iota
	CEST_HASH_SHA1
	CEST_HASH_SHA256
	CEST_HASH_SHA384
	CEST_HASH_SHA512
)
View Source
const (
	CEST_STR_HASH_SHA1   = "sha1"
	CEST_STR_HASH_SHA256 = "sha256"
	CEST_STR_HASH_SHA384 = "sha384"
	CEST_STR_HASH_SHA512 = "sha512"
)
View Source
const (
	CEST_ENGINE_INVALID = iota
	CEST_ENGINE_SW
	CEST_ENGINE_CUSTOM
)
View Source
const (
	CEST_DBTYPE_INVALID = iota
	CEST_DBTYPE_SQLLITE
	CEST_DBTYPE_MYSQL
)
View Source
const (
	CEST_STR_DBTYPE_SQLLITE = "sqllite"
	CEST_STR_DBTYPE_MYSQL   = "mysql"
)
View Source
const (
	CEST_AUTH_METHOD_INVALID = iota
	CEST_AUTH_METHOD_TLSPSK
	CEST_AUTH_METHOD_CERTAUTH
	CEST_AUTH_METHOD_HTTPBASICAUTH
)
View Source
const (
	CEST_STR_AUTH_TLSPSK        = "tls-psk"
	CEST_STR_AUTH_CERTAUTH      = "cert-auth"
	CEST_STR_AUTH_HTTPBASICAUTH = "http-basic-auth"
)
View Source
const (
	CEST_KEYTYPE_INVALID = iota
	CEST_KEYTYPE_RSA
	CEST_KEYTYPE_ECDSA
)
View Source
const (
	CEST_STR_KEYTYPE_RSA   = "rsa"
	CEST_STR_KEYTYPE_ECDSA = "ecdsa"
)
View Source
const (
	CEST_CA_MODE_INVALID = iota
	CEST_CA_MODE_ROOT
	CEST_CA_MODE_SUBCA
)
View Source
const (
	CEST_STR_CA_MODE_ROOT  = "ca"
	CEST_STR_CA_MODE_SUBCA = "subca"
)
View Source
const (
	CEST_VALIDITY_UNIT_DAYS  = "day"
	CEST_VALIDITY_UNIT_HOURS = "hour"
	CEST_VALIDITY_UNIT_YEARS = "year"
)
View Source
const (
	CEST_SIGNATURE_INVALID      = iota
	CEST_SIGNATURE_ECDSA_SHA1   = 9
	CEST_SIGNATURE_ECDSA_SHA256 = 10
	CEST_SIGNATURE_ECDSA_SHA384 = 11
	CEST_SIGNATURE_ECDSA_SHA512 = 12
)

Taken from the x509 package in go lang

View Source
const (
	CEST_STR_SIGNATURE_ECDSA_SHA1   = "ecdsa-with-sha1"
	CEST_STR_SIGNATURE_ECDSA_SHA256 = "ecdsa-with-sha256"
	CEST_STR_SIGNATURE_ECDSA_SHA384 = "ecdsa-with-sha384"
	CEST_STR_SIGNATURE_ECDSA_SHA512 = "ecdsa-with-sha512"
)
View Source
const CEST_AUTH_METHOD_DEFAULT = CEST_AUTH_METHOD_TLSPSK
View Source
const CEST_CA_MODE_DEFAULT = CEST_CA_MODE_ROOT
View Source
const CEST_CA_VALIDITY_DEFAULT = 43830 // In hours
View Source
const CEST_CLIENT_VALIDITY_DEFAULT = 8766 // In hours
View Source
const CEST_CRLSIZE_DEFAULT = 512000
View Source
const CEST_DBFILE_DEFAULT = "est_ca_database.db"
View Source
const CEST_DBTYPE_DEFAULT = CEST_DBTYPE_SQLLITE
View Source
const CEST_ENCRYPTION_DEFAULT = CEST_ENCRYPTION_AES128

Defaults for the configuration

View Source
const CEST_ENCRYPTION_MODE_DEFAULT = CEST_MODE_CBC
View Source
const CEST_ENGINE_DEFAULT = CEST_ENGINE_SW
View Source
const CEST_HASH_DEFAULT = CEST_HASH_SHA256
View Source
const CEST_KEYLENGTH_DEFAULT = 512
View Source
const CEST_KEYTYPE_DEFAULT = CEST_KEYTYPE_ECDSA
View Source
const CEST_SIGNATURE_DEFAULT = CEST_SIGNATURE_ECDSA_SHA512
View Source
const (
	CEST_STR_ENGINE_SW = "sw"
)

Variables

This section is empty.

Functions

func DeleteCAProfilebyName

func DeleteCAProfilebyName(name string)

Delete CA Profile

func DeleteCAbyName

func DeleteCAbyName(name string)

Delete CA Config

func GetCAModeType

func GetCAModeType(s string) uint8

Get CA mode type

func GetCANameList

func GetCANameList() []string

GetCANameList

func GetCRLSize

func GetCRLSize() uint32

Get CRLSize

func GetCryptoEncryptionModeType

func GetCryptoEncryptionModeType(t string) uint8

Get Encryption Mode type

func GetCryptoEncryptionType

func GetCryptoEncryptionType(t string) uint8

Get Crypto Encryption type from String

func GetCryptoHashType

func GetCryptoHashType(t string) uint8

Get Hash type

func GetDBType

func GetDBType(t string) uint8

Get the DB type from string

func GetDebugFlag

func GetDebugFlag() bool

Debug Enabled ?

func GetDefaultCA

func GetDefaultCA() string

Get Default CA

func GetDefaultCAProfile

func GetDefaultCAProfile() string

Get Default CA Profile Name

func GetESTAuthMethod

func GetESTAuthMethod(t string) uint8

Get Auth method type

func GetKeyType

func GetKeyType(t string) uint8

Function to get keytype enum

func GetSignatureType

func GetSignatureType(t string) uint8

Function to get the Signature Algo

func GetValidityInHours

func GetValidityInHours(val uint64, unit string) uint64

find validity in hours given units and number

func InitGlobalConfig

func InitGlobalConfig()

Initializes the global config to defaults

func PrintConfigInfo

func PrintConfigInfo()

Function to Print Config (rewrite later)

func SetAdminInterface

func SetAdminInterface(ip string, port uint16) bool

Set Admin Interface

func SetCABasicAttr

func SetCABasicAttr(ca *CA, maxpath uint8) bool

Set CA basic Attributes

func SetCACRLPath

func SetCACRLPath(ca *CA, crlpath string) bool

Set CA CRL path

func SetCACertPath

func SetCACertPath(ca *CA, cpath, kpath, chainpath string) bool

Set the CA cert paths

func SetCAKeyInfo

func SetCAKeyInfo(ca *CA, ktype string, klen uint16) bool

Set CA Key Info

func SetCAMode

func SetCAMode(ca *CA, camode string) bool

Set the CA mode

func SetCASignatureAlgoritm

func SetCASignatureAlgoritm(ca *CA, algo string) bool

Set CA Signature Algorithm

func SetCASubjectAltName

func SetCASubjectAltName(ca *CA, ip, host string) bool

Set CA Sub Alt name

func SetCASubjectName

func SetCASubjectName(ca *CA, cn, o, c, ou string) bool

Set CA Subjectname

func SetCATLSInfo

func SetCATLSInfo(ca *CA, id, key, tstore string) bool

Set Parent CA TLS info

func SetCAValidity

func SetCAValidity(ca *CA, val uint64, unit string) bool

Set CA validity

func SetCRLSize

func SetCRLSize(s uint32)

Set the CRL size

func SetConfigDefaults

func SetConfigDefaults(conf *CESTConfig)

Set the defaults in a config structure

func SetCryptoEncryptMode

func SetCryptoEncryptMode(enc string) bool

Set Crypto Hash

func SetCryptoEncryption

func SetCryptoEncryption(enc string) bool

Set Crypto Encryption

func SetCryptoHash

func SetCryptoHash(hash string) bool

Set the crypto hash

func SetDBCredentials

func SetDBCredentials(uname string, pass string) bool

Set DB credentials

func SetDBFile

func SetDBFile(file string) bool

Set DB Filename

func SetDBIP

func SetDBIP(ip string, port uint16) bool

Set DB IP/Port

func SetDBTLSInfo

func SetDBTLSInfo(id, key, tstore string) bool

Set DB TLS Info

func SetDBType

func SetDBType(t string) bool

Set DB type

func SetDBURL

func SetDBURL(url string) bool

Set DB URL

func SetDebug

func SetDebug(sense bool)

Set Debug mode

func SetDefaultCA

func SetDefaultCA(name string) bool

Set Default CA if configured

func SetDefaultCAProfile

func SetDefaultCAProfile(name string) bool

Set Default CA Profile if configured

func SetESTAddr

func SetESTAddr(ip string, port uint16) bool

Set EST Interface

func SetESTAuthMethod

func SetESTAuthMethod(auth string) bool

Set EST Auth Method

func SetESTTLSInfo

func SetESTTLSInfo(id, key, tstore string) bool

Set EST TLS params

func SetEnrollParameter

func SetEnrollParameter(ca *CA, fingerprint, uname, passwd string) bool

Set Parent CA EST Params

func SetLDAPAddr

func SetLDAPAddr(ip string, port uint16) bool

Set LDAP IP/Port

func SetLDAPTLSInfo

func SetLDAPTLSInfo(id, key, tstore string) bool

Set LDAP TLS info

func SetLDAPURL

func SetLDAPURL(url string) bool

Set LDAP URL info

func SetParentCAAuthMode

func SetParentCAAuthMode(ca *CA, mode string) bool

Set Parent CA auth mode

func SetParentCAIP

func SetParentCAIP(ca *CA, ip string, port uint16) bool

Set Parent CA IP/Port

func SetParentCAURL

func SetParentCAURL(ca *CA, url string) bool

Set Parent CA URL

func SetProfileBasicAttr

func SetProfileBasicAttr(prof *CAProfile, isca bool, maxpath uint8) bool

Set profile basic Attributes

func SetProfileSubjectAltName

func SetProfileSubjectAltName(prof *CAProfile, ip, host string) bool

Set Profile Sub Alt name

func SetProfileSubjectName

func SetProfileSubjectName(prof *CAProfile, cn, o, c, ou string) bool

Set Profile Subjectname

func SetProfileValidity

func SetProfileValidity(prof *CAProfile, val uint64, unit string) bool

Set validity for profile

Types

type Address

type Address struct {
	Ip   string
	Port uint16
	Url  string
}

type AdminInterface

type AdminInterface struct {
	Addr Address
}

func GetAdminInterface

func GetAdminInterface() *AdminInterface

Get Admin Interface

type CA

type CA struct {
	Name      string
	Mode      uint8
	Certpath  string
	Keypath   string
	Chainpath string
	Crlpath   string
	Validity  uint64
	Csr       CertAttributes
	Key       KeyInfo
	Signature uint8
	Parent    ParentCAInfo
	// contains filtered or unexported fields
}

func CreateCA

func CreateCA(name string) *CA

Create new ca object by name

func FindCAByName

func FindCAByName(name string) *CA

Find CA by name

type CAList

type CAList struct {
	Defaultca string
	// contains filtered or unexported fields
}

type CAProfile

type CAProfile struct {
	Name     string
	Attr     CertAttributes
	Validity uint64
	// contains filtered or unexported fields
}

func CreateCAProfile

func CreateCAProfile(name string) *CAProfile

Create new ca profile object by name

func FindCAProfileByName

func FindCAProfileByName(name string) *CAProfile

Find CA Profile by name

type CAProfileList

type CAProfileList struct {
	Default_prof string
	// contains filtered or unexported fields
}

type CESTConfig

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

func GetGlobalConfig

func GetGlobalConfig() *CESTConfig

Returns the Global Config Block

type CertAttributes

type CertAttributes struct {
	Subname    CertSubjectName
	Subaltname CertSubjectAltName
	Basicattr  CertBasicAttr
}

type CertBasicAttr

type CertBasicAttr struct {
	Isca       bool
	Maxpathlen uint8
}

type CertSubjectAltName

type CertSubjectAltName struct {
	Ip   string
	Host string
}

type CertSubjectName

type CertSubjectName struct {
	Cn string
	O  string
	C  string
	Ou string
}

type Crypto

type Crypto struct {
	Encryption uint8
	Mode       uint8
	Hash       uint8
	Engine     uint8
}

func GetCryptoParams

func GetCryptoParams() *Crypto

Get Crypto Params

type DBInfo

type DBInfo struct {
	Dbtype uint8
	Dbfile string
	Addr   Address
	Uname  string
	Passwd string
	Tls    TLSInfo
}

func GetDBInfo

func GetDBInfo() *DBInfo

Get DB

type ESTInterface

type ESTInterface struct {
	Addr       Address
	Authmethod uint8
	Tls        TLSInfo
}

func GetESTInterface

func GetESTInterface() *ESTInterface

Get EST Interface

type KeyInfo

type KeyInfo struct {
	Ktype  uint8
	Length uint16
}

type LDAPInfo

type LDAPInfo struct {
	Enabled bool
	Addr    Address
	Tls     TLSInfo
}

func GetLDAPInfo

func GetLDAPInfo() *LDAPInfo

Get LDAP Info

type ParentCAInfo

type ParentCAInfo struct {
	Addr          Address
	Authmode      uint8
	Cafingerprint string
	Enrollid      string
	Passwd        string
	Tls           TLSInfo
}

type TLSInfo

type TLSInfo struct {
	Enabled    bool
	Idcertpath string
	Keypath    string
	Tstorepath string
}

Jump to

Keyboard shortcuts

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