Polish commit messages.

This commit is contained in:
Yishi Lin 2017-03-16 00:38:38 +08:00
parent 5ae6de8f23
commit 3d8c1c8478
2 changed files with 22 additions and 4 deletions

View file

@ -10,6 +10,17 @@ import Foundation
import SwiftyUserDefaults
extension PasswordEntity {
var nameWithCategory: String {
get {
if let p = path, p.hasSuffix(".gpg") {
return p.substring(to: p.index(p.endIndex, offsetBy: -4))
} else {
return ""
}
}
}
func decrypt(passphrase: String) throws -> Password? {
var password: Password?
let encryptedDataPath = URL(fileURLWithPath: "\(Globals.repositoryPath)/\(path!)")