Newer
Older
public struct CMixManagerCreate {
public var run: () throws -> CMix
downloadNDF: DownloadAndVerifySignedNdf,
generateSecret: GenerateSecret,
passwordStorage: PasswordStorage,
directoryPath: String,
fileManager: FileManager,
loadCMix: LoadCMix
) -> CMixManagerCreate {
CMixManagerCreate {
let ndfData = try downloadNDF(ndfEnvironment)
let password = generateSecret()
try passwordStorage.save(password)
try? fileManager.removeItem(atPath: directoryPath)
try? fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true)
ndfJSON: String(data: ndfData, encoding: .utf8)!,
storageDir: directoryPath,
password: password,
registrationCode: nil
)
storageDir: directoryPath,
password: password,
extension CMixManagerCreate {
public static let unimplemented = CMixManagerCreate(