mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-19 22:12:26 +00:00
Restore that
This commit is contained in:
parent
c5fe36cde1
commit
1e76513d0a
@ -121,27 +121,27 @@ extension SecureEnclave.Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func loadSecrets() {
|
private func loadSecrets() {
|
||||||
// let attributes = [
|
let attributes = [
|
||||||
// kSecClass: kSecClassKey,
|
kSecClass: kSecClassKey,
|
||||||
// kSecAttrKeyType: SecureEnclave.Constants.keyType,
|
kSecAttrKeyType: SecureEnclave.Constants.keyType,
|
||||||
// kSecAttrApplicationTag: SecureEnclave.Constants.keyTag,
|
kSecAttrApplicationTag: SecureEnclave.Constants.keyTag,
|
||||||
// kSecAttrKeyClass: kSecAttrKeyClassPublic,
|
kSecAttrKeyClass: kSecAttrKeyClassPublic,
|
||||||
// kSecReturnRef: true,
|
kSecReturnRef: true,
|
||||||
// kSecMatchLimit: kSecMatchLimitAll,
|
kSecMatchLimit: kSecMatchLimitAll,
|
||||||
// kSecReturnAttributes: true
|
kSecReturnAttributes: true
|
||||||
// ] as CFDictionary
|
] as CFDictionary
|
||||||
// var untyped: CFTypeRef?
|
var untyped: CFTypeRef?
|
||||||
// SecItemCopyMatching(attributes, &untyped)
|
SecItemCopyMatching(attributes, &untyped)
|
||||||
// guard let typed = untyped as? [[CFString: Any]] else { return }
|
guard let typed = untyped as? [[CFString: Any]] else { return }
|
||||||
// let wrapped: [SecureEnclave.Secret] = typed.map {
|
let wrapped: [SecureEnclave.Secret] = typed.map {
|
||||||
// let name = $0[kSecAttrLabel] as? String ?? "Unnamed"
|
let name = $0[kSecAttrLabel] as? String ?? "Unnamed"
|
||||||
// let id = $0[kSecAttrApplicationLabel] as! Data
|
let id = $0[kSecAttrApplicationLabel] as! Data
|
||||||
// let publicKeyRef = $0[kSecValueRef] as! SecKey
|
let publicKeyRef = $0[kSecValueRef] as! SecKey
|
||||||
// let publicKeyAttributes = SecKeyCopyAttributes(publicKeyRef) as! [CFString: Any]
|
let publicKeyAttributes = SecKeyCopyAttributes(publicKeyRef) as! [CFString: Any]
|
||||||
// let publicKey = publicKeyAttributes[kSecValueData] as! Data
|
let publicKey = publicKeyAttributes[kSecValueData] as! Data
|
||||||
// return SecureEnclave.Secret(id: id, name: name, publicKey: publicKey)
|
return SecureEnclave.Secret(id: id, name: name, publicKey: publicKey)
|
||||||
// }
|
}
|
||||||
// secrets.append(contentsOf: wrapped)
|
secrets.append(contentsOf: wrapped)
|
||||||
}
|
}
|
||||||
|
|
||||||
private func savePublicKey(_ publicKey: SecKey, name: String) throws {
|
private func savePublicKey(_ publicKey: SecKey, name: String) throws {
|
||||||
|
Loading…
Reference in New Issue
Block a user