Go x509 包中的 IsCA 证书设置

IsCA certificate setting in Go x509 package

创建中间根证书时,是否设置了证书模板的"IsCA"属性?这个属性到底是做什么的?

我正在为应用程序创建证书链。在此应用程序中,我需要使用中间证书来签署一些客户端证书。我找到了一些关于创建根 CA 证书的指南,它们指示在创建证书模板时设置 IsCA = true,但我找不到关于创建中间根的任何信息。 IsCA 属性 还需要设置吗?创建中间证书与根证书时,证书模板是否有任何其他更改?

您必须为中间证书设置 cA 基本约束。此布尔值表示证书可用于验证其他证书签名。

未将 cA 设置为 true 的证书是叶证书。

这里是RFC 5280的“基本约束”部分的相关部分:

The cA boolean indicates whether the certified public key may be used to verify certificate signatures. If the cA boolean is not asserted, then the keyCertSign bit in the key usage extension MUST NOT be asserted. If the basic constraints extension is not present in a version 3 certificate, or the extension is present but the cA boolean is not asserted, then the certified public key MUST NOT be used to verify certificate signatures.