getCert 从证书数据中提取证书

This commit is contained in:
李子铭 2024-10-23 15:53:21 +08:00
parent a241f05370
commit 48907c4653
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ func hex2dec(hex string) string {
return fmt.Sprintf("%d", dec) return fmt.Sprintf("%d", dec)
} }
// getCert 从证书数据中提取证书
func getCert(certData []byte) (*x509.Certificate, error) { func getCert(certData []byte) (*x509.Certificate, error) {
block, _ := pem.Decode(certData) block, _ := pem.Decode(certData)
if block == nil { if block == nil {