feat: v1.7.7, add pk_point_hex_compressed
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -326,7 +326,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.7.6"
|
version = "1.7.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"authenticator",
|
"authenticator",
|
||||||
"base64 0.21.4",
|
"base64 0.21.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "card-cli"
|
name = "card-cli"
|
||||||
version = "1.7.6"
|
version = "1.7.7"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,14 @@ impl Command for CommandImpl {
|
|||||||
let public_key_bit_string = &cert.subject_public_key_info.subject_public_key;
|
let public_key_bit_string = &cert.subject_public_key_info.subject_public_key;
|
||||||
match algorithm_id {
|
match algorithm_id {
|
||||||
AlgorithmId::EccP256 | AlgorithmId::EccP384 => {
|
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