Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想读取 DER 格式的服务器证书并将其存储在我们的数据库中,我找到了一个使用 X509 结构打印证书的 api,但我没有看到任何 API 可以将其作为字符串获取。谁能指出API或任何示例来阅读证书?
据我所知,您有两种存储证书的选择。第一种方式,将你的 DB 列类型设置为 BLOB,然后存储二进制证书数据。
第二种方法,将您的 DB 列类型设置为 TEXT,使用 Base64 对您的证书数据进行编码,然后存储编码后的字符串。当您需要使用证书时,Base64 将其解码回 ASN.1/DER。