【发布时间】:2015-07-03 22:47:56
【问题描述】:
我有一个 iOS 应用程序尝试使用 openSSL 从证书中检索 SAN。我被困在我可以正确获取 X509_Extension 的部分(我可以检查 X509_Extension 中的数据,它包含电子邮件地址,混合在一堆其他数据中)。我不知道如何从 X509_Extension 中提取电子邮件地址。
有人可以帮忙吗?谢谢。以下是我的代码:
int loc = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1);
if (loc >= 0) {
X509_EXTENSION * ext = X509_get_ext(cert, loc);
//How to extract the email address from the ext?
}
【问题讨论】: