feat: update swift-secure-enclave-tool.swift
This commit is contained in:
@@ -172,17 +172,17 @@ if (command == "is_support_secure_enclave") {
|
|||||||
exitWith("ok:\(isSupportSecureEnclave())")
|
exitWith("ok:\(isSupportSecureEnclave())")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "generate_secure_enclave_p256_ecsign_keypair") {
|
if (command == "generate_p256_ecsign_keypair") {
|
||||||
let requireBio = readArgumentAsBool(index: 2, defaultValue: true)
|
let requireBio = readArgumentAsBool(index: 2, defaultValue: true)
|
||||||
exitWith(generateSecureEnclaveP256KeyPair(sign: true, requireBio: requireBio))
|
exitWith(generateSecureEnclaveP256KeyPair(sign: true, requireBio: requireBio))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "generate_secure_enclave_p256_ecdh_keypair") {
|
if (command == "generate_p256_ecdh_keypair") {
|
||||||
let requireBio = readArgumentAsBool(index: 2, defaultValue: true)
|
let requireBio = readArgumentAsBool(index: 2, defaultValue: true)
|
||||||
exitWith(generateSecureEnclaveP256KeyPair(sign: false, requireBio: requireBio))
|
exitWith(generateSecureEnclaveP256KeyPair(sign: false, requireBio: requireBio))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "recover_secure_enclave_p256_ecsign_public_key") {
|
if (command == "recover_p256_ecsign_public_key") {
|
||||||
if (CommandLine.arguments.count != 3) {
|
if (CommandLine.arguments.count != 3) {
|
||||||
exitWith("err:require two arguments")
|
exitWith("err:require two arguments")
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ if (command == "recover_secure_enclave_p256_ecsign_public_key") {
|
|||||||
exitWith(response)
|
exitWith(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "recover_secure_enclave_p256_ecdh_public_key") {
|
if (command == "recover_p256_ecdh_public_key") {
|
||||||
if (CommandLine.arguments.count != 3) {
|
if (CommandLine.arguments.count != 3) {
|
||||||
exitWith("err:require two arguments")
|
exitWith("err:require two arguments")
|
||||||
}
|
}
|
||||||
@@ -200,7 +200,7 @@ if (command == "recover_secure_enclave_p256_ecdh_public_key") {
|
|||||||
exitWith(response)
|
exitWith(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "compute_secure_enclave_p256_ecsign") {
|
if (command == "compute_p256_ecsign") {
|
||||||
if (CommandLine.arguments.count != 4) {
|
if (CommandLine.arguments.count != 4) {
|
||||||
exitWith("err:require three arguments")
|
exitWith("err:require three arguments")
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ if (command == "compute_secure_enclave_p256_ecsign") {
|
|||||||
exitWith(response)
|
exitWith(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "compute_secure_enclave_p256_ecdh") {
|
if (command == "compute_p256_ecdh") {
|
||||||
if (CommandLine.arguments.count != 4) {
|
if (CommandLine.arguments.count != 4) {
|
||||||
exitWith("err:require three arguments")
|
exitWith("err:require three arguments")
|
||||||
}
|
}
|
||||||
@@ -228,15 +228,15 @@ if (command == "version") {
|
|||||||
|
|
||||||
if (command == "help") {
|
if (command == "help") {
|
||||||
print("swift-secure-enclave-tool <command>")
|
print("swift-secure-enclave-tool <command>")
|
||||||
print("help - print help")
|
print("help - print help")
|
||||||
print("version - print version")
|
print("version - print version")
|
||||||
print("is_support_secure_enclave - print is support Secure Enclave")
|
print("is_support_secure_enclave - is Secure Enclave supported")
|
||||||
print("generate_secure_enclave_p256_ecsign_keypair [requireBio] - generate Secure Enclave P256 EC sign key pair")
|
print("generate_p256_ecsign_keypair [requireBio] - generate Secure Enclave P256 EC sign key pair")
|
||||||
print("generate_secure_enclave_p256_ecdh_keypair [requireBio] - generate Secure Enclave P256 EC DH key pair")
|
print("generate_p256_ecdh_keypair [requireBio] - generate Secure Enclave P256 EC DH key pair")
|
||||||
print("recover_secure_enclave_p256_ecsign_public_key <privateKey> - recover Secure Enclave P256 EC sign key pair")
|
print("recover_p256_ecsign_public_key <privateKey> - recover Secure Enclave P256 EC sign key pair")
|
||||||
print("recover_secure_enclave_p256_ecdh_public_key <privateKey> - recover Secure Enclave P256 EC DH key pair")
|
print("recover_p256_ecdh_public_key <privateKey> - recover Secure Enclave P256 EC DH key pair")
|
||||||
print("compute_secure_enclave_p256_ecsign <privateKey> <content> - compure Secure Enclave P256 EC sign")
|
print("compute_p256_ecsign <privateKey> <content> - compure Secure Enclave P256 EC sign")
|
||||||
print("compute_secure_enclave_p256_ecdh <privateKey> <ephemeraPublicKey> - compure Secure Enclave P256 EC DH")
|
print("compute_p256_ecdh <privateKey> <ephemeraPublicKey> - compure Secure Enclave P256 EC DH")
|
||||||
print()
|
print()
|
||||||
print("options:")
|
print("options:")
|
||||||
print("> requireBio - true or false (default true)")
|
print("> requireBio - true or false (default true)")
|
||||||
|
|||||||
Reference in New Issue
Block a user