颁发者名称和信息应由颁发 CA 填写,而不是由主题填写。请参阅https://www.rfc-editor.org/rfc/rfc2986#page-5上的 CSR 结构。
由于发行人名称不存在于结构中,因此您无法设置。您可以在https://github.com/openssl/openssl/blob/b69ae442a3b3e168d73c53dcd04bacf33eee8569/crypto/include/internal/x509_int.h查看结构定义
/* PKCS#10 certificate request */
struct X509_req_info_st {
ASN1_ENCODING enc; /* cached encoding of signed part */
ASN1_INTEGER *version; /* version, defaults to v1(0) so can be NULL */
X509_NAME *subject; /* certificate request DN */
X509_PUBKEY *pubkey; /* public key of request */
/*
* Zero or more attributes.
* NB: although attributes is a mandatory field some broken
* encodings omit it so this may be NULL in that case.
*/
STACK_OF(X509_ATTRIBUTE) *attributes;
};
struct X509_req_st {
X509_REQ_INFO req_info; /* signed certificate request data */
X509_ALGOR sig_alg; /* signature algorithm */
ASN1_BIT_STRING *signature; /* signature */
CRYPTO_REF_COUNT references;
CRYPTO_RWLOCK *lock;
};
如您所见,请求结构中没有颁发者名称,您无法设置它。