Initial implementation of using YubiKey for decryption (#533)
This commit is contained in:
parent
13804b79e6
commit
955e50c3d3
23 changed files with 606 additions and 118 deletions
|
|
@ -87,12 +87,16 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
|
||||
private func setPGPKeyTableViewCellDetailText() {
|
||||
var label = "NotSet".localize()
|
||||
|
||||
let keyID = (try? PGPAgent.shared.getShortKeyID()) ?? []
|
||||
if keyID.count == 1 {
|
||||
label = keyID.first ?? ""
|
||||
} else if keyID.count > 1 {
|
||||
label = "Multiple"
|
||||
}
|
||||
if Defaults.isYubiKeyEnabled {
|
||||
label += "+YubiKey"
|
||||
}
|
||||
pgpKeyTableViewCell.detailTextLabel?.text = label
|
||||
}
|
||||
|
||||
|
|
@ -180,6 +184,13 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
|
|||
)
|
||||
}
|
||||
|
||||
optionMenu.addAction(
|
||||
UIAlertAction(title: Defaults.isYubiKeyEnabled ? "✓ YubiKey" : "YubiKey", style: .default) { _ in
|
||||
Defaults.isYubiKeyEnabled.toggle()
|
||||
self.setPGPKeyTableViewCellDetailText()
|
||||
}
|
||||
)
|
||||
|
||||
if Defaults.pgpKeySource != nil {
|
||||
optionMenu.addAction(
|
||||
UIAlertAction(title: "RemovePgpKeys".localize(), style: .destructive) { _ in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue