Update KeycardCommandSet.swift

fix export key
This commit is contained in:
Bitgamma 2021-02-02 14:29:11 +03:00 committed by GitHub
parent c17903500e
commit 36e260cfaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ public class KeycardCommandSet {
public func exportKey(path: String, makeCurrent: Bool, publicOnly: Bool) throws -> APDUResponse {
let path = try KeyPath(path)
let p1 = (makeCurrent ? ExportKeyP1.deriveAndMakeCurrent.rawValue : ExportKeyP1.deriveAndMakeCurrent.rawValue) | path.source.rawValue
let p1 = (makeCurrent ? ExportKeyP1.deriveAndMakeCurrent.rawValue : ExportKeyP1.deriveKey.rawValue) | path.source.rawValue
let p2 = publicOnly ? ExportKeyP2.publicOnly.rawValue : ExportKeyP2.privateAndPublic.rawValue
return try exportKey(p1: p1, p2: p2, data: path.data)
}