Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigEnv() string
- func GetDBConfig() string
- func GetFlagPath() string
- func InitConfig(configPath string)
- func SetConfig(envPath string)
- type AccessControlConf
- type AllConfig
- func (ac *AllConfig) GetAccessControlConf() []*AccessControlConf
- func (ac *AllConfig) GetBaseConf() *BaseConf
- func (ac *AllConfig) GetCaType() string
- func (ac *AllConfig) GetCanIssueCa() bool
- func (ac *AllConfig) GetDBConf() *DBConfig
- func (ac *AllConfig) GetDefaultCertValidTime() time.Duration
- func (ac *AllConfig) GetDefaultDomain() string
- func (ac *AllConfig) GetDefaultExpireMonth() int
- func (ac *AllConfig) GetDefaultExpireYear() int
- func (ac *AllConfig) GetHashType() string
- func (ac *AllConfig) GetIntermediateConf() []*ImCaConfig
- func (ac *AllConfig) GetKeyType() string
- func (ac *AllConfig) GetLogConf() *loggers.LogConifg
- func (ac *AllConfig) GetPkcs11Conf() *Pkcs11Conf
- func (ac *AllConfig) GetPkcs11Enabled() bool
- func (ac *AllConfig) GetProvideServiceFor() []string
- func (ac *AllConfig) GetRootCertConf() []*CertConf
- func (ac *AllConfig) GetRootConf() *CaConfig
- func (ac *AllConfig) GetRootCsrConf() *CsrConf
- func (ac *AllConfig) GetServerPort() string
- func (ac *AllConfig) IsAccessControl() bool
- func (ac *AllConfig) IsKeyEncrypt() bool
- type BaseConf
- type CaConfig
- type CaType
- type CertConf
- type CsrConf
- type DBConfig
- type ImCaConfig
- type Pkcs11Conf
Constants ¶
View Source
const ( //DefaultPrivateKeyPwd default private pwd DefaultPrivateKeyPwd = "" //DefaultWorkDirectory default work dir DefaultWorkDirectory = "./" //DefaultCRLNextTime default crl next time DefaultCRLNextTime = time.Hour * 24 //DefaultTokenSecretKey default token secret key DefaultTokenSecretKey = "1045836262777123654" )
Variables ¶
View Source
var CaType2NameMap = map[CaType]string{ TLS: "tls", SIGN: "sign", SINGLE_ROOT: "single_root", DOUBLE_ROOT: "double_root", }
CaType2NameMap Ca type to string name
View Source
var HashType2NameMap = map[crypto.HashType]string{ crypto.HASH_TYPE_SM3: "SM3", crypto.HASH_TYPE_SHA256: "SHA256", crypto.HASH_TYPE_SHA3_256: "SHA3_256", }
View Source
var Name2CaTypeMap = map[string]CaType{ "tls": TLS, "sign": SIGN, "single_root": SINGLE_ROOT, "double_root": DOUBLE_ROOT, }
Name2CaTypeMap string name to ca type
View Source
var Name2HashTypeMap = map[string]crypto.HashType{ "SM3": crypto.HASH_TYPE_SM3, "SHA256": crypto.HASH_TYPE_SHA256, "SHA3_256": crypto.HASH_TYPE_SHA3_256, }
Functions ¶
func GetConfigEnv ¶
func GetConfigEnv() string
GetConfigEnv --Specify the path and name of the configuration file (Env)
Types ¶
type AccessControlConf ¶
type AllConfig ¶
type AllConfig struct { LogConf *loggers.LogConifg `mapstructure:"log_config"` DBConf *DBConfig `mapstructure:"db_config"` BaseConf *BaseConf `mapstructure:"base_config"` RootCaConf *CaConfig `mapstructure:"root_config"` IntermediateCaConfs []*ImCaConfig `mapstructure:"intermediate_config"` AccessControlConfs []*AccessControlConf `mapstructure:"access_control_config"` Pkcs11Conf *Pkcs11Conf `mapstructure:"pkcs11_config"` }
func (*AllConfig) GetAccessControlConf ¶
func (ac *AllConfig) GetAccessControlConf() []*AccessControlConf
func (*AllConfig) GetDefaultCertValidTime ¶
func (*AllConfig) GetIntermediateConf ¶
func (ac *AllConfig) GetIntermediateConf() []*ImCaConfig
func (*AllConfig) GetPkcs11Conf ¶
func (ac *AllConfig) GetPkcs11Conf() *Pkcs11Conf
type BaseConf ¶
type BaseConf struct { ServerPort string `mapstructure:"server_port"` CaType string `mapstructure:"ca_type"` ExpireYear int `mapstructure:"expire_year"` ExpireMonth int `mapstructure:"expire_month"` // For test CertValidTime time.Duration `mapstructure:"cert_valid_time"` HashType string `mapstructure:"hash_type"` KeyType string `mapstructure:"key_type"` CanIssueca bool `mapstructure:"can_issue_ca"` ProvideServiceFor []string `mapstructure:"provide_service_for"` IsKeyEncrypt bool `mapstructure:"key_encrypt"` AccessControl bool `mapstructure:"access_control"` DefaultDomain string `mapstructure:"default_domain"` }
type CaConfig ¶
type CertConf ¶
type CsrConf ¶
type DBConfig ¶
type DBConfig struct { User string `mapstructure:"user"` Password string `mapstructure:"password"` IP string `mapstructure:"ip"` Port string `mapstructure:"port"` DbName string `mapstructure:"dbname"` }
DBConfig /
type ImCaConfig ¶
Click to show internal directories.
Click to hide internal directories.