【问题标题】:Convert the x509 certPool to pemBytes将 x509 certPool 转换为 pemBytes
【发布时间】:2019-10-04 19:08:41
【问题描述】:

Go 中有一个函数:

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

但没有办法反其道而行之。

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

【问题讨论】:

    标签: go ssl x509


    【解决方案1】:

    struct field containing the []*Certificate is unexported,并且没有公开它们的函数。可能会保护他们免受您想要做的事情的影响。因此,按原样使用包,没有办法做到这一点。也没有定义 interfaces,因此您也无法使用此附加功能提供自己的 CertPool 实现。

    【讨论】:

      猜你喜欢
      • 2016-06-29
      • 2015-07-21
      • 2019-06-12
      • 2015-10-19
      • 1970-01-01
      • 1970-01-01
      • 2021-08-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多