Support folder in password view

- change core data
  - change data struct to store table view entry
  - delete unnecessary functions
This commit is contained in:
Bob Sun 2017-03-02 14:51:40 +08:00
parent 98b01d16cf
commit 050a960167
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 177 additions and 89 deletions

View file

@ -12,7 +12,7 @@ import SwiftyUserDefaults
extension PasswordEntity {
func decrypt(passphrase: String) throws -> Password? {
var password: Password?
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.repositoryPath)/\(rawPath!)")
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.repositoryPath)/\(path!)")
let encryptedData = try Data(contentsOf: encryptedDataPath)
let decryptedData = try PasswordStore.shared.pgp.decryptData(encryptedData, passphrase: passphrase)
let plainText = String(data: decryptedData, encoding: .utf8) ?? ""