feat: v1.7.7, add pk_point_hex_compressed
This commit is contained in:
@@ -85,7 +85,14 @@ impl Command for CommandImpl {
|
||||
let public_key_bit_string = &cert.subject_public_key_info.subject_public_key;
|
||||
match algorithm_id {
|
||||
AlgorithmId::EccP256 | AlgorithmId::EccP384 => {
|
||||
json.insert("pk_point_hex", hex::encode(public_key_bit_string.raw_bytes()));
|
||||
let pk_point_hex = public_key_bit_string.raw_bytes();
|
||||
json.insert("pk_point_hex", hex::encode(pk_point_hex));
|
||||
if pk_point_hex[0] == 0x04 {
|
||||
json.insert(
|
||||
"pk_point_hex_compressed",
|
||||
format!("02{}", hex::encode(&pk_point_hex[1..(pk_point_hex.len() / 2) + 1])),
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user