feat: update x509-parser version

This commit is contained in:
2023-08-26 12:25:04 +08:00
parent 1698e2d9f8
commit ffd0e6233f
4 changed files with 19 additions and 23 deletions

View File

@@ -23,9 +23,9 @@ pub fn get_pki_algorithm(algorithm_identifier: &AlgorithmIdentifier) -> XResult<
}
if "1.2.840.10045.2.1" == algorithm_id_string {
if let Some(parameters) = &algorithm_identifier.parameters {
if let Ok(content) = parameters.content.as_oid() {
let content_id_string = content.to_id_string();
return match content_id_string.as_str() {
if let Ok(parameter_oid) = parameters.as_oid() {
let parameter_oid_id_string = parameter_oid.to_id_string();
return match parameter_oid_id_string.as_str() {
"1.2.840.10045.3.1.7" => Ok(PkiAlgorithm::P256),
"1.3.132.0.34" => Ok(PkiAlgorithm::P384),
"1.3.132.0.35" => Ok(PkiAlgorithm::P521),