From 3e65995810804ca6c9c90bea76faed3db49bf7f1 Mon Sep 17 00:00:00 2001 From: Consuelita Date: Wed, 6 Mar 2019 17:45:05 -0600 Subject: [PATCH] Public Key Permanence --- .../Polish/PolishController.swift | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Sources/ReplicantSwift/Polish/PolishController.swift b/Sources/ReplicantSwift/Polish/PolishController.swift index 50a90de..92c0412 100644 --- a/Sources/ReplicantSwift/Polish/PolishController.swift +++ b/Sources/ReplicantSwift/Polish/PolishController.swift @@ -155,15 +155,21 @@ public struct PolishController let privateKeyAttributes: [String: Any] = [ kSecAttrIsPermanent as String: true, - kSecAttrApplicationTag as String: polishTag, + kSecAttrApplicationTag as String: polishTag //kSecAttrAccessControl as String: access ] + let publicKeyAttributes: [String: Any] = [ + kSecAttrIsPermanent as String: true, + kSecAttrApplicationTag as String: polishTag + ] + let attributes: [String: Any] = [ kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits as String: 256, //kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, - kSecPrivateKeyAttrs as String: privateKeyAttributes + kSecPrivateKeyAttrs as String: privateKeyAttributes, + kSecPublicKeyAttrs as String: publicKeyAttributes ] return attributes as CFDictionary @@ -176,15 +182,21 @@ public struct PolishController let privateKeyAttributes: [String: Any] = [ kSecAttrIsPermanent as String: true, - kSecAttrApplicationTag as String: polishServerTag, + kSecAttrApplicationTag as String: polishServerTag //kSecAttrAccessControl as String: access ] + let publicKeyAttributes: [String: Any] = [ + kSecAttrIsPermanent as String: true, + kSecAttrApplicationTag as String: polishServerTag + ] + let attributes: [String: Any] = [ kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits as String: 256, //kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, - kSecPrivateKeyAttrs as String: privateKeyAttributes + kSecPrivateKeyAttrs as String: privateKeyAttributes, + kSecPublicKeyAttrs as String: publicKeyAttributes ] return attributes as CFDictionary