如何换行 X509 证书字符串?

How do I line break X509 certificate string?

通常,当从另一个站点下载 X509 证书文件时,它由几行组成。

-----BEGIN CERTIFICATE-----
MIIDETCCAfmgAwIBAgIJAI+TpAQ6jj2zMA0GCSqGSIb3DQEBCwUAMB8xHTAbBgNV
BAoMFE9yZ2FuaXphdGlvbiwgQ049TFNHMB4XDTIwMDUxODA1MjQxNloXDTIwMDYx
...

你有什么断线的标准吗?还是我应该打破这条线看起来不错?

我有一个 Base64 编码的单行证书字符串。
此证书文件旨在从网络上下载。

问候我!

根据RFC 1421 and RFC 7468

Generators MUST wrap the base64-encoded lines so that each line consists of exactly 64 characters except for the final line, which will encode the remainder of the data (within the 64-character line boundary), and they MUST NOT emit extraneous whitespace. Parsers MAY handle other line sizes. These requirements are consistent with PEM [RFC1421].