须要先调用函数X509_get_pubkey()得到公钥属性结构体,然后通过type字段来推断公钥的算法类型。 详细实现函数例如以下: ULONG COpenSSLCertificate::get_KeyType(ULONG* pulType) { EVP_PKEY *pk = NULL; stack_st_X509* chain = NULL; X509_EXTENSION *pex = NULL; if (!m_pX509) { return CERT_ERR_INV...
EVP_PKEY* X509_get_pubkey (X509* x); 9、创建和释放证书存储区域 X509_STORE * X509_STORE_new(void); void_X509_STORE_free(X509_STORE * v); 函数:创建和发布一个X509_STORE结构,主要用于认证。 10. 将证书添加到证书存储区域 Int_X509_STORE_add_cert(X509_STORE * ctx X509 * x); 函数:将信...
EVP_PKEY *X509_get_pubkey(X509 *x); 9、 创建和释放证书存储区 X509_STORE *X509_STORE_new(void); Void X509_STORE_free(X509_STORE *v); 函数功能:创建和释放一个X509_STORE结构体,主要用于验证证书。 10、向证书存储区添加证书 Int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); 函数功能:添...
stack_st_X509* chain = NULL; X509_EXTENSION *pex = NULL; if (!m_pX509) { return CERT_ERR_INVILIDCALL; } if (!pulType) { return CERT_ERR_INVALIDPARAM; } pk = X509_get_pubkey(m_pX509); if (!pk) { return CERT_ERR_FAILED; } if (EVP_PKEY_RSA == pk->type) { *pulType ...
print("公钥:\n" ,OpenSSL.crypto.dump_publickey(OpenSSL.crypto.FILETYPE_PEM, cert.get_pubkey()).decode("utf-8")) print("主体信息:") print("CN : 通用名称 OU : 机构单元名称") print("O : 机构名 L : 地理位置") print("S : 州/省名 C : 国名") ...
int X509_REQ_set_version(X509_REQ *x, long version); 设置证书请求的版本。 成功返回1,失败返回0。 long X509_REQ_get_version(const X509_REQ *req); 读取证书请求的版本。 X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned ch...
EVP_PKEY *X509_get_pubkey(X509 *x); 9、创建和释放证书存储区 X509_STORE *X509_STORE_new(void); Void X509_STORE_free(X509_STORE *v); 函数功能:创建和释放一个X509_STORE结构体,主要用于验证证书。 10、向证书存储区添加证书 Int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); ...
EVP_PKEY*pk=NULL;pk=X509_get_pubkey(cert);NSString*pulType;if(EVP_PKEY_RSA==pk->type){pulType=@"RSA";}elseif(EVP_PKEY_EC==pk->type){pulType=@"EC";}elseif(EVP_PKEY_DSA==pk->type){pulType=@"DSA";}elseif(EVP_PKEY_DH==pk->type){pulType=@"DH";}else{pulType=@"UNKNOWN"...
int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); X509_REQ_extract_key(a) int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); int X509_REQ_sign(X509_REQ *x, ...
int X509_REQ_set_version(X509_REQ *x,long version);int X509_REQ_set_subject_name(X5 10、09_REQ *req,X509_NAME *name);int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req);X509_REQ_extract_key(a)int X509_REQ_verify(X509_REQ *a...