-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17f4e99
commit f3709f1
Showing
10 changed files
with
420 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// FRAppAuthKeys.swift | ||
// FRAuth | ||
// | ||
// Copyright (c) 2023 ForgeRock. All rights reserved. | ||
// | ||
// This software may be modified and distributed under the terms | ||
// of the MIT license. See the LICENSE file for details. | ||
// | ||
|
||
|
||
import Foundation | ||
|
||
public struct FRAppIntegrityKeys { | ||
|
||
public private(set) var appAttestKey: String | ||
public private(set) var assertKey: String? = nil | ||
public private(set) var keyIdentifier: String | ||
public private(set) var clientDataHash: String | ||
private let key = "com.forgerock.ios.appattest.keychainservice" | ||
private let keychain: KeychainManager? = FRAuth.shared?.keychainManager | ||
|
||
public init(attestKey: String = String(), | ||
assertKey: String? = nil, | ||
keyIdentifier: String = String(), | ||
clientDataHash: String = String()) { | ||
self.appAttestKey = attestKey | ||
self.assertKey = assertKey | ||
self.keyIdentifier = keyIdentifier | ||
self.clientDataHash = clientDataHash | ||
} | ||
|
||
internal func updateKey(value: String) { | ||
self.keychain?.privateStore.set(value, key: key) | ||
} | ||
|
||
internal func getKey() -> String? { | ||
return self.keychain?.privateStore.getString(key) | ||
} | ||
|
||
public func isAttestationCompleted() -> Bool { | ||
return self.getKey() != nil | ||
} | ||
|
||
public func deleteKey() { | ||
self.keychain?.privateStore.delete(key) | ||
} | ||
|
||
} |
Oops, something went wrong.