将x509 certPool转换为pemBytes

问题描述 投票:0回答:1

Go中有一个功能:

func (s *CertPool) AppendCertsFromPEM(pemCerts []byte) (ok bool)

但是没有相反的方法。

如何将x509.CertPool转换为PEM字节?

go ssl x509
1个回答
0
投票

struct field containing the []*Certificate is unexported,并且没有公开它们的函数。可能会保护他们免受您想要做的事情的影响。因此,按原样使用该程序包无法执行此操作。也没有定义[]*Certificate,因此您也无法使用此添加的功能来提供自己的interface实现。

© www.soinside.com 2019 - 2024. All rights reserved.