Created
November 27, 2017 13:53
-
-
Save badlands/0ec225d5c0a245bf504d5f6899e9bf62 to your computer and use it in GitHub Desktop.
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
static let keypair: EllipticCurveKeyPair.Manager = { | |
EllipticCurveKeyPair.logger = { print($0) } | |
let publicAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAfterFirstUnlock, flags: []) // QUA: kSecAttrAccessibleAlways | |
let privateAccessControl = EllipticCurveKeyPair.AccessControl(protection: kSecAttrAccessibleAfterFirstUnlock, flags: [.privateKeyUsage]) // QUA: kSecAttrAccessibleAlways | |
let config = EllipticCurveKeyPair.Config( | |
publicLabel: "no.agens.encrypt.public", | |
privateLabel: "no.agens.encrypt.private", | |
operationPrompt: "", | |
publicKeyAccessControl: publicAccessControl, | |
privateKeyAccessControl: privateAccessControl, | |
token: .secureEnclaveIfAvailable) | |
return EllipticCurveKeyPair.Manager(config: config) | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment