代码解析 static const OidToAlgorithmName g_oidToNameMap[] = { { "1.2.840.113549.1.1.2", "MD2withRSA" }, { "1.2.840.113549.1.1.4", "MD5withRSA" }, { "1.2.840.113549.1.1.5", "SHA1withRSA" }, { "1.2.840.10040.4.3", "SHA1withDSA" }, { "1.2.840.10045.4.1", "SHA1withECDSA" }, { "1.2.840.113549.1.1.14", "SHA224withRSA" }, { "1.2.840.113549.1.1.11", "SHA256withRSA" }, { "1.2.840.113549.1.1.12", "SHA384withRSA" }, { "1.2.840.113549.1.1.13", "SHA512withRSA" }, { "2.16.840.1.101.3.4.3.1", "SHA224withDSA" }, { "2.16.840.1.101.3.4.3.2", "SHA256withDSA" }, { "1.2.840.10045.4.3.1", "SHA224withECDSA" }, { "1.2.840.10045.4.3.2", "SHA256withECDSA" }, { "1.2.840.10045.4.3.3", "SHA384withECDSA" }, { "1.2.840.10045.4.3.4", "SHA512withECDSA" } };
时间: 2023-08-27 18:18:25 浏览: 115
这是一个结构体数组 g_oidToNameMap,用于将 OID (Object Identifier) 转换为签名算法名称。该数组中的每个元素都是一个结构体 OidToAlgorithmName,包含两个字段:oid 和 name。oid 是一个字符串类型的 OID,name 则是对应的签名算法名称。数组中包含了多个常见的签名算法 OID 和名称的映射关系,例如 "1.2.840.113549.1.1.2" 对应 "MD2withRSA","1.2.840.113549.1.1.4" 对应 "MD5withRSA" 等。在 GetSigAlgNameX509Openssl 函数中,该数组通过调用 GetAlgorithmName 函数来获取相应的签名算法名称。
阅读全文