extcert

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCrt

func LoadCrt(cert string) ([]byte, error)

LoadCrt 加载tls cert 如果cert有"base64://"前缀,直接解析后面的字符串,否则认为这是个cert文件名

func LoadCrtAndKeyFile

func LoadCrtAndKeyFile(crtFilename, keyFilename string) (crt, key []byte, err error)

LoadCrtAndKeyFile 读取根证书文件和私钥文件

func LoadCrtFile

func LoadCrtFile(filename string) (*x509.Certificate, error)

LoadCrtFile 解析根证书文件

func LoadKey

func LoadKey(key string) ([]byte, error)

LoadKey 加载tls key 如果key有"base64://"前缀,直接解析后面的字符串,否则认为这是个key文件名

func LoadKeyFile

func LoadKeyFile(filename string) (*rsa.PrivateKey, error)

LoadKeyFile 解析私钥文件

func LoadPair

func LoadPair(cert, key string) (certBytes, keyBytes []byte, err error)

LoadPair 加载tls cert key 如果cert有"base64://"前缀,直接解析后面的字符串,否则认为这是个cert文件名 如果key有"base64://"前缀,直接解析后面的字符串,否则认为这是个key文件名

func ParseCrt

func ParseCrt(b []byte) (*x509.Certificate, error)

ParseCrt 解析根证书

func ParseCrtAndKey

func ParseCrtAndKey(crt, key []byte) (ca *x509.Certificate, privateKey *rsa.PrivateKey, err error)

ParseCrtAndKey 解析根证书和私钥

func ParseCrtAndKeyFile

func ParseCrtAndKeyFile(crtFilename, keyFilename string) (ca *x509.Certificate, key *rsa.PrivateKey, err error)

ParseCrtAndKeyFile 解析根证书文件和私钥文件

func ParseKey

func ParseKey(b []byte) (*rsa.PrivateKey, error)

ParseKey 解析私钥

Types

This section is empty.

Jump to

Keyboard shortcuts

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