From 8073174d9841e7df7e1c1e76fecbd3357b7dcbc8 Mon Sep 17 00:00:00 2001 From: sydneymorton Date: Thu, 8 Oct 2020 17:04:35 -0700 Subject: [PATCH] Fix nits from last PR --- .../VCEntities.xcodeproj/project.pbxproj | 4 ++++ .../formatters/FormatterHelpers.swift | 2 +- .../formatters/IdentifierFormatter.swift | 16 ++++++------- .../IssuanceResponseFormatter.swift | 2 +- .../PresentationResponseFormatter.swift | 2 +- .../VerifiablePresentationFormatter.swift | 2 +- .../VCEntities/identifier/Identifier.swift | 24 +++---------------- .../identifier/IdentifierCreator.swift | 4 ++-- .../VCEntities/identifier/KeyContainer.swift | 24 +++++++++++++++++++ .../VCEntities/util/JSONCodingKeys.swift | 3 --- .../formatters/IdentifierFormatterTests.swift | 4 +--- .../IssuanceResponseFormatterTests.swift | 4 ++-- .../PresentationResponseFormatterTests.swift | 6 ++--- .../identifier/IdentifierCreatorTests.swift | 2 +- .../mocks/MockIdentifierFormatter.swift | 2 +- .../VCUseCaseTests/IssuanceUseCaseTests.swift | 2 +- .../PresentationUseCaseTests.swift | 2 +- 17 files changed, 55 insertions(+), 50 deletions(-) create mode 100644 VCEntities/VCEntities/identifier/KeyContainer.swift diff --git a/VCEntities/VCEntities.xcodeproj/project.pbxproj b/VCEntities/VCEntities.xcodeproj/project.pbxproj index c29336e..588ec93 100644 --- a/VCEntities/VCEntities.xcodeproj/project.pbxproj +++ b/VCEntities/VCEntities.xcodeproj/project.pbxproj @@ -24,6 +24,7 @@ 551F3068252E97000081D5E7 /* IdentifierCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 551F3067252E97000081D5E7 /* IdentifierCreator.swift */; }; 55253976252FCA6D003202D5 /* VCCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55253975252FCA6D003202D5 /* VCCrypto.framework */; }; 55253977252FCA6D003202D5 /* VCCrypto.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 55253975252FCA6D003202D5 /* VCCrypto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 55253982252FDF89003202D5 /* KeyContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55253981252FDF89003202D5 /* KeyContainer.swift */; }; 55575738251BC575009979AB /* VCEntities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5557572E251BC575009979AB /* VCEntities.framework */; }; 5557573D251BC575009979AB /* VCEntitiesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5557573C251BC575009979AB /* VCEntitiesTests.swift */; }; 5557573F251BC575009979AB /* VCEntities.h in Headers */ = {isa = PBXBuildFile; fileRef = 55575731251BC575009979AB /* VCEntities.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -123,6 +124,7 @@ 551F3065252E71680081D5E7 /* MultihashTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultihashTests.swift; sourceTree = ""; }; 551F3067252E97000081D5E7 /* IdentifierCreator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentifierCreator.swift; sourceTree = ""; }; 55253975252FCA6D003202D5 /* VCCrypto.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = VCCrypto.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 55253981252FDF89003202D5 /* KeyContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyContainer.swift; sourceTree = ""; }; 5557572E251BC575009979AB /* VCEntities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VCEntities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55575731251BC575009979AB /* VCEntities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VCEntities.h; sourceTree = ""; }; 55575732251BC575009979AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -353,6 +355,7 @@ 55AF7482252F6A7E006A8B25 /* document */, 55AF748D252F6BE0006A8B25 /* Identifier.swift */, 551F3067252E97000081D5E7 /* IdentifierCreator.swift */, + 55253981252FDF89003202D5 /* KeyContainer.swift */, ); path = identifier; sourceTree = ""; @@ -584,6 +587,7 @@ 5518CC7625264D5700C7A21B /* ResponseMappings.swift in Sources */, 551F3068252E97000081D5E7 /* IdentifierCreator.swift in Sources */, 551F305B252E39540081D5E7 /* IdentifierFormatter.swift in Sources */, + 55253982252FDF89003202D5 /* KeyContainer.swift in Sources */, 557BFC53251E665D005B5B24 /* IssuanceResponseFormatter.swift in Sources */, 5584E4A02525656500A9DE58 /* SchemaDescriptor.swift in Sources */, 55575766251BC6CF009979AB /* LogoDisplayDescriptor.swift in Sources */, diff --git a/VCEntities/VCEntities/formatters/FormatterHelpers.swift b/VCEntities/VCEntities/formatters/FormatterHelpers.swift index 4c3e19d..8d38d8b 100644 --- a/VCEntities/VCEntities/formatters/FormatterHelpers.swift +++ b/VCEntities/VCEntities/formatters/FormatterHelpers.swift @@ -14,6 +14,6 @@ func createTokenTimeConstraints(expiryInSeconds: Int) -> TokenTimeConstraints { } func formatHeaders(usingIdentifier identifier: Identifier, andSigningKey key: KeyContainer) -> Header { - let keyId = identifier.longformId + "#" + key.keyId + let keyId = identifier.longFormDid + "#" + key.keyId return Header(type: jwtType, algorithm: key.algorithm, keyId: keyId) } diff --git a/VCEntities/VCEntities/formatters/IdentifierFormatter.swift b/VCEntities/VCEntities/formatters/IdentifierFormatter.swift index 14e7347..37ce625 100644 --- a/VCEntities/VCEntities/formatters/IdentifierFormatter.swift +++ b/VCEntities/VCEntities/formatters/IdentifierFormatter.swift @@ -6,7 +6,7 @@ import VCJwt protocol IdentifierFormatting { - func createIonLongForm(recoveryKey: ECPublicJwk, + func createIonLongFormDid(recoveryKey: ECPublicJwk, updateKey: ECPublicJwk, didDocumentKeys: [ECPublicJwk], serviceEndpoints: [IdentifierDocumentServiceEndpoint]) throws -> String @@ -17,18 +17,18 @@ struct IdentifierFormatter: IdentifierFormatting { private let multihash: Multihash = Multihash() private let encoder: JSONEncoder = JSONEncoder() - private let ionPrefix = "did:ion:" - private let ionQueryValue = "?-ion-initial-state=" - private let replaceAction = "replace" + private static let ionPrefix = "did:ion:" + private static let ionQueryValue = "?-ion-initial-state=" + private static let replaceAction = "replace" - func createIonLongForm(recoveryKey: ECPublicJwk, + func createIonLongFormDid(recoveryKey: ECPublicJwk, updateKey: ECPublicJwk, didDocumentKeys: [ECPublicJwk], serviceEndpoints: [IdentifierDocumentServiceEndpoint]) throws -> String { let document = IdentifierDocument(fromJwks: didDocumentKeys, andServiceEndpoints: serviceEndpoints) - let patches = [IdentifierDocumentPatch(action: replaceAction, document: document)] + let patches = [IdentifierDocumentPatch(action: IdentifierFormatter.replaceAction, document: document)] let commitmentHash = try self.createCommitmentHash(usingJwk: updateKey) let delta = IdentifierDocumentDeltaDescriptor(updateCommitment: commitmentHash, patches: patches) @@ -46,7 +46,7 @@ struct IdentifierFormatter: IdentifierFormatting { let shortForm = try self.createShortFormIdentifier(usingSuffixData: suffixData) - return shortForm + ionQueryValue + encodedPayload + return shortForm + IdentifierFormatter.ionQueryValue + encodedPayload } private func createShortFormIdentifier(usingSuffixData data: SuffixDescriptor) throws -> String { @@ -54,7 +54,7 @@ struct IdentifierFormatter: IdentifierFormatting { let encodedData = try encoder.encode(data) let hashedSuffixData = multihash.compute(from: encodedData).base64URLEncodedString() - return ionPrefix + hashedSuffixData + return IdentifierFormatter.ionPrefix + hashedSuffixData } private func createSuffixData(usingDelta delta: IdentifierDocumentDeltaDescriptor, recoveryKey: ECPublicJwk) throws -> SuffixDescriptor { diff --git a/VCEntities/VCEntities/formatters/IssuanceResponseFormatter.swift b/VCEntities/VCEntities/formatters/IssuanceResponseFormatter.swift index 4dc9cd1..ab208da 100644 --- a/VCEntities/VCEntities/formatters/IssuanceResponseFormatter.swift +++ b/VCEntities/VCEntities/formatters/IssuanceResponseFormatter.swift @@ -37,7 +37,7 @@ public class IssuanceResponseFormatter: IssuanceResponseFormatting { return IssuanceResponseClaims(publicKeyThumbprint: try publicKey.getThumbprint(), audience: response.audience, - did: identifier.longformId, + did: identifier.longFormDid, publicJwk: publicKey, contract: response.contractUri, jti: UUID().uuidString, diff --git a/VCEntities/VCEntities/formatters/PresentationResponseFormatter.swift b/VCEntities/VCEntities/formatters/PresentationResponseFormatter.swift index b98bbe0..947759e 100644 --- a/VCEntities/VCEntities/formatters/PresentationResponseFormatter.swift +++ b/VCEntities/VCEntities/formatters/PresentationResponseFormatter.swift @@ -49,7 +49,7 @@ public class PresentationResponseFormatter: PresentationResponseFormatting { return PresentationResponseClaims(publicKeyThumbprint: try publicKey.getThumbprint(), audience: response.request.content.redirectURI, - did: identifier.longformId, + did: identifier.longFormDid, publicJwk: publicKey, jti: UUID().uuidString, presentationSubmission: presentationSubmission, diff --git a/VCEntities/VCEntities/formatters/VerifiablePresentationFormatter.swift b/VCEntities/VCEntities/formatters/VerifiablePresentationFormatter.swift index 4bb4c30..4c66f3f 100644 --- a/VCEntities/VCEntities/formatters/VerifiablePresentationFormatter.swift +++ b/VCEntities/VCEntities/formatters/VerifiablePresentationFormatter.swift @@ -30,7 +30,7 @@ class VerifiablePresentationFormatter { let vpClaims = VerifiablePresentationClaims(vpId: UUID().uuidString, purpose: PURPOSE, verifiablePresentation: verifiablePresentationDescriptor, - issuerOfVp: identifier.longformId, + issuerOfVp: identifier.longFormDid, audience: audience, iat: timeConstraints.issuedAt, exp: timeConstraints.expiration) diff --git a/VCEntities/VCEntities/identifier/Identifier.swift b/VCEntities/VCEntities/identifier/Identifier.swift index 046e521..2f8d484 100644 --- a/VCEntities/VCEntities/identifier/Identifier.swift +++ b/VCEntities/VCEntities/identifier/Identifier.swift @@ -6,36 +6,18 @@ import VCCrypto public struct Identifier { - public let longformId: String + public let longFormDid: String let didDocumentKeys: [KeyContainer] let updateKey: KeyContainer let recoveryKey: KeyContainer - public init(longformId: String, + public init(longFormDid: String, didDocumentKeys: [KeyContainer], updateKey: KeyContainer, recoveryKey: KeyContainer) { - self.longformId = longformId + self.longFormDid = longFormDid self.didDocumentKeys = didDocumentKeys self.updateKey = updateKey self.recoveryKey = recoveryKey } } - -public struct KeyContainer { - - /// key reference to key in Secret Store - let keyReference: VCCryptoSecret - - /// keyId to specify key in Identifier Document (must be less than 20 chars long) - let keyId: String - - /// Always ES256K because we only support Secp256k1 keys - let algorithm: String = "ES256K" - - public init(keyReference: VCCryptoSecret, - keyId: String) { - self.keyReference = keyReference - self.keyId = keyId - } -} diff --git a/VCEntities/VCEntities/identifier/IdentifierCreator.swift b/VCEntities/VCEntities/identifier/IdentifierCreator.swift index 5b247e5..749843c 100644 --- a/VCEntities/VCEntities/identifier/IdentifierCreator.swift +++ b/VCEntities/VCEntities/identifier/IdentifierCreator.swift @@ -27,7 +27,7 @@ public struct IdentifierCreator { let recoveryKeyContainer = KeyContainer(keyReference: try self.cryptoOperations.generateKey(), keyId: "recover") let longformDid = try self.createLongformDid(signingKeyContainer: signingKeyContainer, updateKeyContainer: updateKeyContainer, recoveryKeyContainer: recoveryKeyContainer) - return Identifier(longformId: longformDid, didDocumentKeys: [signingKeyContainer], updateKey: updateKeyContainer, recoveryKey: recoveryKeyContainer) + return Identifier(longFormDid: longformDid, didDocumentKeys: [signingKeyContainer], updateKey: updateKeyContainer, recoveryKey: recoveryKeyContainer) } @@ -35,7 +35,7 @@ public struct IdentifierCreator { 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: []) + return try self.identifierFormatter.createIonLongFormDid(recoveryKey: recoveryJwk, updateKey: updateJwk, didDocumentKeys: [signingJwk], serviceEndpoints: []) } private func generatePublicJwk(for keyMapping: KeyContainer) throws -> ECPublicJwk { diff --git a/VCEntities/VCEntities/identifier/KeyContainer.swift b/VCEntities/VCEntities/identifier/KeyContainer.swift new file mode 100644 index 0000000..de2436c --- /dev/null +++ b/VCEntities/VCEntities/identifier/KeyContainer.swift @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. See License.txt in the project root for license information. +*--------------------------------------------------------------------------------------------*/ + +import VCCrypto + +public struct KeyContainer { + + /// key reference to key in Secret Store + let keyReference: VCCryptoSecret + + /// keyId to specify key in Identifier Document (must be less than 20 chars long) + let keyId: String + + /// Always ES256K because we only support Secp256k1 keys + let algorithm: String = "ES256K" + + public init(keyReference: VCCryptoSecret, + keyId: String) { + self.keyReference = keyReference + self.keyId = keyId + } +} diff --git a/VCEntities/VCEntities/util/JSONCodingKeys.swift b/VCEntities/VCEntities/util/JSONCodingKeys.swift index 203a1c7..b6ef64d 100644 --- a/VCEntities/VCEntities/util/JSONCodingKeys.swift +++ b/VCEntities/VCEntities/util/JSONCodingKeys.swift @@ -42,8 +42,6 @@ public extension KeyedDecodingContainer { } } - - public extension KeyedEncodingContainerProtocol where Key == JSONCodingKeys { mutating func encode(_ value: Dictionary) throws { try value.forEach({ (key, value) in @@ -76,4 +74,3 @@ public extension KeyedEncodingContainerProtocol { } } } - diff --git a/VCEntities/VCEntitiesTests/formatters/IdentifierFormatterTests.swift b/VCEntities/VCEntitiesTests/formatters/IdentifierFormatterTests.swift index 4ebd0fd..00f8b20 100644 --- a/VCEntities/VCEntitiesTests/formatters/IdentifierFormatterTests.swift +++ b/VCEntities/VCEntitiesTests/formatters/IdentifierFormatterTests.swift @@ -15,10 +15,8 @@ class IdentifierFormatterTests: XCTestCase { func testFormatting() throws { let key = ECPublicJwk(x: "Ir5lqT2yDCXdWI8HgMj2erz9HVChFFv4Bd70oDqclvs", y: "_uSQb2NNO3MMnsS83ByMxayGbk3ODYxAlMx-_YOw5oc", keyId: "testKey") - let actualDid = try formatter.createIonLongForm(recoveryKey: key, updateKey: key, didDocumentKeys: [key], serviceEndpoints: []) + let actualDid = try formatter.createIonLongFormDid(recoveryKey: key, updateKey: key, didDocumentKeys: [key], serviceEndpoints: []) XCTAssertEqual(actualDid, expectedDid) } - - } diff --git a/VCEntities/VCEntitiesTests/formatters/IssuanceResponseFormatterTests.swift b/VCEntities/VCEntitiesTests/formatters/IssuanceResponseFormatterTests.swift index 850e824..802ee67 100644 --- a/VCEntities/VCEntitiesTests/formatters/IssuanceResponseFormatterTests.swift +++ b/VCEntities/VCEntitiesTests/formatters/IssuanceResponseFormatterTests.swift @@ -29,12 +29,12 @@ class IssuanceResponseFormatterTests: XCTestCase { let key = try cryptoOperation.generateKey() let keyContainer = KeyContainer(keyReference: key, keyId: "keyId") - self.mockIdentifier = Identifier(longformId: "longFormDid", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) + self.mockIdentifier = Identifier(longFormDid: "longFormDid", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) } func testFormatToken() throws { let formattedToken = try formatter.format(response: self.mockResponse, usingIdentifier: self.mockIdentifier) - XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longformId) + XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longFormDid) XCTAssertEqual(formattedToken.content.contract, self.mockResponse.contractUri) XCTAssertEqual(formattedToken.content.audience, self.mockResponse.audience) XCTAssert(MockTokenSigner.wasSignCalled) diff --git a/VCEntities/VCEntitiesTests/formatters/PresentationResponseFormatterTests.swift b/VCEntities/VCEntitiesTests/formatters/PresentationResponseFormatterTests.swift index de85f8c..ad0c1e3 100644 --- a/VCEntities/VCEntitiesTests/formatters/PresentationResponseFormatterTests.swift +++ b/VCEntities/VCEntitiesTests/formatters/PresentationResponseFormatterTests.swift @@ -31,7 +31,7 @@ class PresentationResponseFormatterTests: XCTestCase { let key = try cryptoOperation.generateKey() let keyContainer = KeyContainer(keyReference: key, keyId: "keyId") - self.mockIdentifier = Identifier(longformId: "longFormDid", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) + self.mockIdentifier = Identifier(longFormDid: "longFormDid", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) } func testFormatToken() throws { @@ -40,7 +40,7 @@ class PresentationResponseFormatterTests: XCTestCase { let formattedToken = try formatter.format(response: self.mockResponse, usingIdentifier: self.mockIdentifier) - XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longformId) + XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longFormDid) XCTAssertNotNil(formattedToken.content.exp) XCTAssertNotNil(formattedToken.content.iat) XCTAssertNotNil(formattedToken.content.jti) @@ -59,7 +59,7 @@ class PresentationResponseFormatterTests: XCTestCase { func testFormatTokenNoVcs() throws { let formattedToken = try formatter.format(response: self.mockResponse, usingIdentifier: self.mockIdentifier) - XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longformId) + XCTAssertEqual(formattedToken.content.did, self.mockIdentifier.longFormDid) XCTAssertNotNil(formattedToken.content.exp) XCTAssertNotNil(formattedToken.content.iat) XCTAssertNotNil(formattedToken.content.jti) diff --git a/VCEntities/VCEntitiesTests/identifier/IdentifierCreatorTests.swift b/VCEntities/VCEntitiesTests/identifier/IdentifierCreatorTests.swift index 4cc34fb..c1379cb 100644 --- a/VCEntities/VCEntitiesTests/identifier/IdentifierCreatorTests.swift +++ b/VCEntities/VCEntitiesTests/identifier/IdentifierCreatorTests.swift @@ -24,7 +24,7 @@ class IdentifierCreatorTests: XCTestCase { let creator = IdentifierCreator(cryptoOperations: self.cryptoOperations, identifierFormatter: MockIdentifierFormatter(returningString: self.expectedResult)) let actualResult = try creator.create() XCTAssertEqual(MockCryptoOperations.generateKeyCallCount, 3) - XCTAssertEqual(actualResult.longformId, expectedResult) + XCTAssertEqual(actualResult.longFormDid, expectedResult) } func testCreateIdentifierWithCryptoOperations() throws { diff --git a/VCEntities/VCEntitiesTests/mocks/MockIdentifierFormatter.swift b/VCEntities/VCEntitiesTests/mocks/MockIdentifierFormatter.swift index 7d9e1a1..d82f3c1 100644 --- a/VCEntities/VCEntitiesTests/mocks/MockIdentifierFormatter.swift +++ b/VCEntities/VCEntitiesTests/mocks/MockIdentifierFormatter.swift @@ -15,7 +15,7 @@ struct MockIdentifierFormatter: IdentifierFormatting { self.returningString = returningString } - func createIonLongForm(recoveryKey: ECPublicJwk, updateKey: ECPublicJwk, didDocumentKeys: [ECPublicJwk], serviceEndpoints: [IdentifierDocumentServiceEndpoint]) throws -> String { + func createIonLongFormDid(recoveryKey: ECPublicJwk, updateKey: ECPublicJwk, didDocumentKeys: [ECPublicJwk], serviceEndpoints: [IdentifierDocumentServiceEndpoint]) throws -> String { return self.returningString } } diff --git a/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift b/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift index 993bf38..7c33b2e 100644 --- a/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift +++ b/VCUseCase/VCUseCaseTests/IssuanceUseCaseTests.swift @@ -25,7 +25,7 @@ class IssuanceUseCaseTests: XCTestCase { self.contract = try JSONDecoder().decode(Contract.self, from: encodedContract) let keyContainer = KeyContainer(keyReference: MockVCCryptoSecret(), keyId: "keyId234") - self.mockIdentifier = Identifier(longformId: "longform", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) + self.mockIdentifier = Identifier(longFormDid: "longform", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) MockIssuanceResponseFormatter.wasFormatCalled = false MockApiCalls.wasPostCalled = false diff --git a/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift b/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift index ffe1faf..8af3725 100644 --- a/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift +++ b/VCUseCase/VCUseCaseTests/PresentationUseCaseTests.swift @@ -24,7 +24,7 @@ class PresentationUseCaseTests: XCTestCase { self.presentationRequest = PresentationRequest(from: TestData.presentationRequest.rawValue)! let keyContainer = KeyContainer(keyReference: MockVCCryptoSecret(), keyId: "keyId234") - self.mockIdentifier = Identifier(longformId: "longform", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) + self.mockIdentifier = Identifier(longFormDid: "longform", didDocumentKeys: [keyContainer], updateKey: keyContainer, recoveryKey: keyContainer) MockPresentationResponseFormatter.wasFormatCalled = false MockApiCalls.wasPostCalled = false