feat: add ExtractCertificatesFromPEM util func

This commit is contained in:
Fu Diwei
2025-02-06 13:11:40 +08:00
parent bc29cce645
commit 5f5c835533
7 changed files with 125 additions and 97 deletions

View File

@@ -13,6 +13,7 @@ import (
)
// 从 PEM 编码的证书字符串解析并返回一个 x509.Certificate 对象。
// PEM 内容可能是包含多张证书的证书链,但只返回第一个证书(即服务器证书)。
//
// 入参:
// - certPem: 证书 PEM 内容。