2012-04-05 40 views

回答

5

一個ASN1_OBJECT只是OpenSSL表示的一個OID,一個對象標識符。如果您只想知道它是OID,那麼:

ASN1_OBJECT *obj = X509_EXTENSION_get_object(ex); // ex is your X509_EXTENSION * 
char buff[1024]; 
OBJ_obj2txt(buff, 1024, obj, 0); // 0 means it will prefer a textual representation (if available) rather than the numerical one 

然後buf將包含帶有OID的C字符串。

問候。

相關問題