143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
guard let documentDirectory = NSSearchPathForDirectoriesInDomains(
.documentDirectory, .userDomainMask, true).first
else {
print("Could not get key files: No documents directory")
return
}
let keyFilePath =
documentDirectory.ofObject.appending(keyFile.ofObject)
generator.keyFile = OFMutableData(contentsOfFile: keyFilePath)
}
let passphraseText = (passphraseField?.text ?? "") as NSString
let passphraseLen =
passphraseText.lengthOfBytes(using: String.Encoding.utf8.rawValue)
let passphrase = OFSecureData(count: passphraseLen,
|
|
|
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
guard let documentDirectory = NSSearchPathForDirectoriesInDomains(
.documentDirectory, .userDomainMask, true).first
else {
print("Could not get key files: No documents directory")
return
}
let keyFilePath = documentDirectory.ofObject.appendingPathComponent(
keyFile.ofObject)
generator.keyFile = OFMutableData(contentsOfFile: keyFilePath)
}
let passphraseText = (passphraseField?.text ?? "") as NSString
let passphraseLen =
passphraseText.lengthOfBytes(using: String.Encoding.utf8.rawValue)
let passphrase = OFSecureData(count: passphraseLen,
|