Commit b7394178 authored by Drew's avatar Drew

Rev API

parent f7b7c5fa
Pipeline #2770 failed with stage
in 4 seconds
This diff is collapsed.
......@@ -21,17 +21,20 @@
import Foundation
import NaOH
/**Creates a new identity and writes it to the specified file. */
public func createIdentity(_ file: String) throws {
let identity = CryptoBoxSecretKey()
try identity.saveToFile(file)
extension FISA {
/**Creates a new identity and writes it to the specified file. */
public static func createIdentity(_ file: String) throws {
let identity = CryptoBoxSecretKey()
try identity.saveToFile(file)
}
/**Gets the public portion of the identity, as base64 */
public static func getPublicIdentity(_ file: String) throws -> String {
let identity = try CryptoBoxPublicKey(readFromFile: file)
return identity.bytes.base64
}
}
/**Gets the public portion of the identity, as base64 */
public func getPublicIdentity(_ file: String) throws -> String {
let identity = try CryptoBoxPublicKey(readFromFile: file)
return identity.bytes.base64
}
enum FISAKitError : Error {
case invalidFISAFile(Int)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment