在验证 x509 证书时,`permitted_public_key_algorithms` 和 `permitted_signature_algorithms` 并未公开
作者: twilleke创建于 2025年9月3日更新于 2026年6月28日
标签x509
我正在验证一个具有 `ED25519` 密钥的证书,并且证书颁发机构也具有 `ED25519` 密钥。但是即使证书有效,我也会收到以下错误: cryptography.hazmat.bindings._rust.x509.VerificationError: 验证失败: 候选项用尽: 禁止的公钥算法: AlgorithmIdentifier { oid: DefinedByMarker(PhantomData<asn1::object_identifier::ObjectIdentifier>), params: Ed25519 } 这似乎是因为在创建策略时,选择了 WebPKI 默认值,而 WebPKI 不允许 `ED25519` 密钥。 https://GitHub.com/pyca/cryptography/blob/1a952fc144b74c6e09577865184ad3fc8ad24b15/src/Rust/cryptography-x509-verification/src/policy/mod.rs#L257-L258 我没有找到在 Python 端设置这些参数的方法。这是否是疏忽,还是有意为之?
内容来源: pyca/cryptography