From 0f945331be8ada79f10293a3b8ea84773cf5aedb Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Fri, 3 Jun 2022 11:52:38 +0200 Subject: [PATCH] Refactor --- Sources/ElixxirDAppsSDK/Identity.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Sources/ElixxirDAppsSDK/Identity.swift b/Sources/ElixxirDAppsSDK/Identity.swift index 116fea14..f192f6af 100644 --- a/Sources/ElixxirDAppsSDK/Identity.swift +++ b/Sources/ElixxirDAppsSDK/Identity.swift @@ -1,13 +1,6 @@ import Foundation -public struct Identity: Equatable, Codable { - enum CodingKeys: String, CodingKey { - case id = "ID" - case rsaPrivatePem = "RSAPrivatePem" - case salt = "Salt" - case dhKeyPrivate = "DHKeyPrivate" - } - +public struct Identity: Equatable { public init( id: Data, rsaPrivatePem: Data, @@ -25,3 +18,12 @@ public struct Identity: Equatable, Codable { public var salt: Data public var dhKeyPrivate: Data } + +extension Identity: Codable { + enum CodingKeys: String, CodingKey { + case id = "ID" + case rsaPrivatePem = "RSAPrivatePem" + case salt = "Salt" + case dhKeyPrivate = "DHKeyPrivate" + } +} -- GitLab