diff --git a/VCCrypto/VcCrypto/Algo/Secp256k1.swift b/VCCrypto/VcCrypto/Algo/Secp256k1.swift index 7e2698b..28c2f71 100644 --- a/VCCrypto/VcCrypto/Algo/Secp256k1.swift +++ b/VCCrypto/VcCrypto/Algo/Secp256k1.swift @@ -28,7 +28,6 @@ public struct Secp256k1: Signing { public func sign(messageHash: Data, withSecret secret: VCCryptoSecret) throws -> Data { // Validate params - print(secret.id.uuidString) guard secret is Secret else { throw Secp256k1Error.invalidSecret } guard messageHash.count == 32 else { throw Secp256k1Error.invalidMessageHash } diff --git a/VCEntities/VCEntities/identifier/IdentifierCreator.swift b/VCEntities/VCEntities/identifier/IdentifierCreator.swift index 595d7c6..5b247e5 100644 --- a/VCEntities/VCEntities/identifier/IdentifierCreator.swift +++ b/VCEntities/VCEntities/identifier/IdentifierCreator.swift @@ -22,19 +22,19 @@ public struct IdentifierCreator { } public func create() throws -> Identifier { - let signingKeyMapping = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "sign") - let updateKeyMapping = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "update") - let recoveryKeyMapping = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "recover") + let signingKeyContainer = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "sign") + let updateKeyContainer = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "update") + let recoveryKeyContainer = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "recover") - let longformDid = try self.createLongformDid(signingKeyMapping: signingKeyMapping, updateKeyMapping: updateKeyMapping, recoveryKeyMapping: recoveryKeyMapping) - return Identifier(longformId: longformDid, didDocumentKeys: [signingKeyMapping], updateKey: updateKeyMapping, recoveryKey: recoveryKeyMapping) + let longformDid = try self.createLongformDid(signingKeyContainer: signingKeyContainer, updateKeyContainer: updateKeyContainer, recoveryKeyContainer: recoveryKeyContainer) + return Identifier(longformId: longformDid, didDocumentKeys: [signingKeyContainer], updateKey: updateKeyContainer, recoveryKey: recoveryKeyContainer) } - private func createLongformDid(signingKeyMapping: KeyContainer, updateKeyMapping: KeyContainer, recoveryKeyMapping: KeyContainer) throws -> String { - let signingJwk = try self.generatePublicJwk(for: signingKeyMapping) - let updateJwk = try self.generatePublicJwk(for: updateKeyMapping) - let recoveryJwk = try self.generatePublicJwk(for: recoveryKeyMapping) + private func createLongformDid(signingKeyContainer: KeyContainer, updateKeyContainer: KeyContainer, recoveryKeyContainer: KeyContainer) throws -> String { + let signingJwk = try self.generatePublicJwk(for: signingKeyContainer) + let updateJwk = try self.generatePublicJwk(for: updateKeyContainer) + let recoveryJwk = try self.generatePublicJwk(for: recoveryKeyContainer) return try self.identifierFormatter.createIonLongForm(recoveryKey: recoveryJwk, updateKey: updateJwk, didDocumentKeys: [signingJwk], serviceEndpoints: []) } diff --git a/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift b/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift index 4103ab0..993bf38 100644 --- a/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift +++ b/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift @@ -6,7 +6,6 @@ import XCTest import VCRepository import VCEntities -import VCCrypto @testable import VCUseCase diff --git a/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift b/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift index 323533b..ffe1faf 100644 --- a/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift +++ b/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift @@ -6,8 +6,6 @@ import XCTest import VCRepository import VCEntities -import VCCrypto -import PromiseKit @testable import VCUseCase