feat: v1.11.1
This commit is contained in:
@@ -9,9 +9,9 @@ pub fn is_support_se() -> bool {
|
||||
|
||||
pub fn generate_secure_enclave_p256_keypair(sign: bool) -> XResult<(Vec<u8>, Vec<u8>, String)> {
|
||||
let key_material = if sign {
|
||||
swift_secure_enclave_tool_rs::generate_ecdsa_keypair(KeyPurpose::Signing, true)?
|
||||
swift_secure_enclave_tool_rs::generate_keypair(KeyPurpose::Signing, true)?
|
||||
} else {
|
||||
swift_secure_enclave_tool_rs::generate_ecdsa_keypair(KeyPurpose::KeyAgreement, true)?
|
||||
swift_secure_enclave_tool_rs::generate_keypair(KeyPurpose::KeyAgreement, true)?
|
||||
};
|
||||
Ok((
|
||||
key_material.public_key_point,
|
||||
@@ -26,12 +26,12 @@ pub fn recover_secure_enclave_p256_public_key(
|
||||
) -> XResult<(Vec<u8>, Vec<u8>, String)> {
|
||||
let private_key_representation = STANDARD.decode(private_key)?;
|
||||
let key_material = if sign {
|
||||
swift_secure_enclave_tool_rs::recover_ecdsa_keypair(
|
||||
swift_secure_enclave_tool_rs::recover_keypair(
|
||||
KeyPurpose::Signing,
|
||||
&private_key_representation,
|
||||
)
|
||||
} else {
|
||||
swift_secure_enclave_tool_rs::recover_ecdsa_keypair(
|
||||
swift_secure_enclave_tool_rs::recover_keypair(
|
||||
KeyPurpose::KeyAgreement,
|
||||
&private_key_representation,
|
||||
)
|
||||
@@ -58,6 +58,6 @@ pub fn secure_enclave_p256_dh(
|
||||
pub fn secure_enclave_p256_sign(private_key: &str, content: &[u8]) -> XResult<Vec<u8>> {
|
||||
let private_key_representation = STANDARD.decode(private_key)?;
|
||||
let signature =
|
||||
swift_secure_enclave_tool_rs::private_key_ecdsa_sign(&private_key_representation, content)?;
|
||||
swift_secure_enclave_tool_rs::private_key_sign(&private_key_representation, content)?;
|
||||
Ok(signature)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user