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.
我正在尝试从 ASN.1/DER 格式的证书中获取 DN。我已经搜索了 OpenSSL,但仍然找不到获取 DN 的确切功能。
有没有人有这方面的经验或者可以给我指点书籍或任何网站?
我已经找到了一种方法来做到这一点。如果有人想做同样的事情,我就放在这里。
X509_NAME * cert_entry = X509_get_issuer_name(cert); unsigned char buff[100] = {0}; unsigned char * p = buff; int i = i2d_X509_NAME(cert_entry,&p); for(int b = 0;b<i;b++) { printf("%02X ",buff[b]); }
这将打印一个六进制格式。