> 文章列表 > X509证书中的Subject Public Key Info

X509证书中的Subject Public Key Info

X509证书中的Subject Public Key Info

SubjectPublicKeyInfo在TBSCertificate的第七项:

 

对于ECC

id-ecPublicKey OBJECT IDENTIFIER ::= {
iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 }

id-ecPublicKey 是必须的

ECParameters ::= CHOICE {
namedCurve OBJECT IDENTIFIER
-- implicitCurve NULL
-- specifiedCurve SpecifiedECDomain
}

ECParameters中的 namedCurve根据曲线的不同而不同

The ECC public key MUST be encoded as an ECC Point. The uncompressed format SHOULD be used.  ( 04 xxxxxx)
ECPoint ::= OCTET STRING
The namedCurve field in ECParameters of the Subject Public Key Info depends on the ECC curve.
 

示例:

SM2 P256 为例

the namedCurve field MUST contain the OID defined in GM/T 0006-2012
Cryptographic Application Identifier Criterion Specification [20]:

SM2EllipticCurveCryptography OBJECT IDENTIFIER ::= {
iso(1) member-body(2) cn(156) ccstc(10197) cryptographic-algorithm (1) 301 }
 

ECC 为例:

ECC P384 密钥类型

OID 1.3.132.0.34 ansip384r1

 

 

 ECC P256 密钥类型

OID 1.2.840.10045.3.1.7 prime256v1

 

 

 

RSA 为例:

The AlgorithmIdentifier parameters field MUST be the ASN.1 type NULL.
 

rsaEncryption OBJECT IDENTIFIER ::= {
iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
The RSA public key MUST be encoded using the ASN.1 type RSAPublicKey as defined in RFC 3279
RSAPublicKey ::= SEQUENCE {

modulus INTEGER,
publicExponent INTEGER }
-- n
-- e

}

 NULL 是 0500