Documentation ¶
Index ¶
- Variables
- func GenerateCertificate(caKey *rsa.PrivateKey, caCert *x509.Certificate, bits int, ...) ([]byte, []byte, error)
- func Main()
- func ReadCertificate(path string) (*x509.Certificate, error)
- func ReadPKCS1PrivateKey(path string) (*rsa.PrivateKey, error)
- func ReadPKCS8PrivateKey(path string) (*rsa.PrivateKey, error)
- func StartupServer() error
- func WriteCertificate(path string, cert []byte) error
- func WritePKCS1PrivateKey(path string, privKey []byte) error
- func WritePKCS8PrivateKey(path string, privKey []byte) error
- type ApplicationInformation
- type CertificateConfig
- type Config
- type Log
- type System
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultGlobalConfig = &Config{ Log: Log{ DisableTimestamp: false, Level: "info", Format: "text", FileName: "/var/log/z-console-server/data.log", MaxSize: 200, }, System: System{ Port: 9090, CertsDir: "/var/run/z-console-server/certs", }, }
DefaultGlobalConfig 默认配置
Functions ¶
func GenerateCertificate ¶
func GenerateCertificate(caKey *rsa.PrivateKey, caCert *x509.Certificate, bits int, info *ApplicationInformation) ([]byte, []byte, error)
GenerateCertificate 生成证书(私钥,证书)
func ReadCertificate ¶
func ReadCertificate(path string) (*x509.Certificate, error)
ReadCertificate 读取证书
func ReadPKCS1PrivateKey ¶
func ReadPKCS1PrivateKey(path string) (*rsa.PrivateKey, error)
ReadPKCS1PrivateKey 读取 PKCS1 私钥
func ReadPKCS8PrivateKey ¶
func ReadPKCS8PrivateKey(path string) (*rsa.PrivateKey, error)
ReadPKCS8PrivateKey 读取 PKCS8 私钥
func WritePKCS1PrivateKey ¶
WritePKCS1PrivateKey 写出 PKCS! 私钥
func WritePKCS8PrivateKey ¶
WritePKCS8PrivateKey 写出 PKCS8 私钥
Types ¶
type ApplicationInformation ¶
type ApplicationInformation struct { CertificateConfig *CertificateConfig CommonName string CountryName string ProvinceName string LocalityName string OrganizationName string OrganizationUnitName string }
ApplicationInformation 申请信息
type CertificateConfig ¶
CertificateConfig 证书配置
Click to show internal directories.
Click to hide internal directories.