@procivis/react-native-one-core 1.77931.0 → 1.81885.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -14
- package/android/build.gradle +0 -11
- package/android/src/main/java/ch/procivis/one/core/ProcivisOneCoreModule.kt +4 -4
- package/android/src/main/java/ch/procivis/one/core/SerializeSpecific.kt +128 -67
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt +5 -8
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt +17 -222
- package/core-sdk.json +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/config.d.ts +3 -2
- package/dist/src/config.js +5 -0
- package/dist/src/core.d.ts +5 -182
- package/dist/src/core.js +5 -19
- package/dist/src/nfc.d.ts +0 -5
- package/dist/src/one-core-uniffi-intf.d.ts +1773 -0
- package/dist/src/one-core-uniffi-intf.js +356 -0
- package/ios/ProcivisOneCoreModule.m +4 -4
- package/ios/ProcivisOneCoreModule.swift +10 -10
- package/ios/RSEKeyStorage.swift +17 -571
- package/ios/RSEPinPad.swift +3 -56
- package/ios/Serialize.swift +80 -27
- package/package.json +4 -2
- package/react-native-one-core.podspec +1 -1
- package/android/build.gradle_opensource +0 -122
- package/android/libs/core-reactnative-compatible-2025.0305.1.aar +0 -0
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadRunner.kt +0 -123
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadViewManager.kt_opensource +0 -20
- package/android/src/main/java/ch/procivis/one/core/ubiqu/PinPadWrapper.kt +0 -396
- package/android/src/main/java/ch/procivis/one/core/ubiqu/RegistrationManager.kt +0 -59
- package/android/src/main/java/ch/procivis/one/core/ubiqu/TokenManager.kt +0 -48
- package/android/src/main/java/ch/procivis/one/core/ubiqu/UbiquKeyStorage.kt_opensource +0 -63
- package/android/src/main/java/ch/procivis/one/core/ubiqu/Util.kt +0 -74
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityRequest.kt +0 -9
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/CreateIdentityResponse.kt +0 -9
- package/android/src/main/java/ch/procivis/one/core/ubiqu/dataformats/RegisterRSEResponse.kt +0 -10
- package/dist/src/backup.d.ts +0 -22
- package/dist/src/backup.js +0 -1
- package/dist/src/cache.d.ts +0 -11
- package/dist/src/cache.js +0 -12
- package/dist/src/credential.d.ts +0 -177
- package/dist/src/credential.js +0 -44
- package/dist/src/credentialSchema.d.ts +0 -135
- package/dist/src/credentialSchema.js +0 -34
- package/dist/src/did.d.ts +0 -63
- package/dist/src/did.js +0 -27
- package/dist/src/history.d.ts +0 -101
- package/dist/src/history.js +0 -63
- package/dist/src/identifier.d.ts +0 -133
- package/dist/src/identifier.js +0 -29
- package/dist/src/key.d.ts +0 -17
- package/dist/src/key.js +0 -1
- package/dist/src/list.d.ts +0 -14
- package/dist/src/list.js +0 -5
- package/dist/src/organisation.d.ts +0 -9
- package/dist/src/organisation.js +0 -1
- package/dist/src/proof.d.ts +0 -234
- package/dist/src/proof.js +0 -43
- package/dist/src/proofSchema.d.ts +0 -116
- package/dist/src/proofSchema.js +0 -9
- package/dist/src/trust.d.ts +0 -173
- package/dist/src/trust.js +0 -44
- package/dist/src/walletUnit.d.ts +0 -30
- package/dist/src/walletUnit.js +0 -11
- package/ios/RSEKeyStorage.swift_opensource +0 -61
- package/ios/RSEPinPad.swift_opensource +0 -21
- package/ios/UBQKit.xcframework/Info.plist +0 -44
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFNetworking.h +0 -41
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Constants.h +0 -222
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ErrorDomains.h +0 -68
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ProtocolBase.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/Settings.h +0 -120
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit-Swift.h +0 -761
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQKit.h +0 -56
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Headers/UBQPacket.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.abi.json +0 -89006
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/Modules/module.modulemap +0 -11
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/_CodeSignature/CodeResources +0 -597
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64/UBQKit.framework/stream +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Assets.car +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFCompatibilityMacros.h +0 -37
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFHTTPSessionManager.h +0 -304
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworkReachabilityManager.h +0 -216
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFNetworking.h +0 -41
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFPlainTextRequestSerializer.h +0 -16
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFSecurityPolicy.h +0 -156
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLRequestSerialization.h +0 -479
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLResponseSerialization.h +0 -310
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/AFURLSessionManager.h +0 -501
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/CardRequestProtocol.h +0 -72
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Constants.h +0 -222
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DeviceBindProtocol.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/DomainSecurityModule.h +0 -43
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ErrorDomains.h +0 -68
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/FreeAssetProtocol.h +0 -40
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/GDataXMLNode.h +0 -214
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSDictionary+Utilities.h +0 -23
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSFileManager+Utilities.h +0 -20
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSString+Utilities.h +0 -23
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/NSURL+Utilities.h +0 -12
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ProtocolBase.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/ResetPinProtocol.h +0 -45
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/Settings.h +0 -120
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequest.h +0 -58
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBaseProcessor.h +0 -37
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestBindProcessor.h +0 -34
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestNullProcessor.h +0 -28
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestResetPinProcessor.h +0 -35
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUnlockProcessor.h +0 -31
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQCardRequestUseProcessor.h +0 -34
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit-Swift.h +0 -1522
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQKit.h +0 -56
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Headers/UBQPacket.h +0 -38
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Info.plist +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -89006
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -89006
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/UBQKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -1099
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/Modules/module.modulemap +0 -11
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/UBQKit +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/_CodeSignature/CodeResources +0 -652
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/certs +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/checksums +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/pinning_pub +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/static +0 -0
- package/ios/UBQKit.xcframework/ios-arm64_x86_64-simulator/UBQKit.framework/stream +0 -0
|
@@ -1,268 +1,63 @@
|
|
|
1
1
|
package ch.procivis.one.core.ubiqu
|
|
2
2
|
|
|
3
|
-
import android.annotation.SuppressLint
|
|
4
|
-
import android.util.Base64
|
|
5
|
-
import android.util.Log
|
|
6
|
-
import androidx.appcompat.app.AppCompatActivity
|
|
7
3
|
import ch.procivis.one.core.GeneratedKeyBindingDto
|
|
8
4
|
import ch.procivis.one.core.NativeKeyStorage
|
|
9
5
|
import ch.procivis.one.core.NativeKeyStorageException
|
|
10
|
-
import ch.procivis.one.core.ubiqu.PinPadRunner.RequestType
|
|
11
|
-
import ch.procivis.one.core.ubiqu.PinPadRunner.cancelPinPadFlow
|
|
12
|
-
import ch.procivis.one.core.ubiqu.PinPadRunner.startPinPadFlow
|
|
13
|
-
import ch.procivis.one.core.ubiqu.Util.asyncCallback
|
|
14
|
-
import ch.procivis.one.core.ubiqu.Util.exceptionWrapper
|
|
15
|
-
import ch.procivis.one.core.ubiqu.Util.runOnUIThread
|
|
16
|
-
import ch.procivis.one.core.ubiqu.dataformats.CreateIdentityRequest
|
|
17
|
-
import ch.procivis.one.core.ubiqu.dataformats.RegisterRSEResponse
|
|
18
6
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
19
|
-
import com.ubiqu.eid.sdk.UbqSdk
|
|
20
|
-
import com.ubiqu.eid.sdk.backend.assets.UbqAsset
|
|
21
|
-
import com.ubiqu.eid.sdk.backend.assets.UbqDerivedAsset
|
|
22
|
-
import com.ubiqu.eid.sdk.dataformats.UnsignedData
|
|
23
|
-
import com.ubiqu.eid.sdk.enums.CryptoTypes
|
|
24
|
-
import com.ubiqu.eid.sdk.enums.UbqAssetState
|
|
25
|
-
import com.ubiqu.eid.sdk.requests.UbqRequestFlow
|
|
26
|
-
import com.ubiqu.eid.sdk.utils.Utilities.checkBiometricsAvailable
|
|
27
|
-
import com.ubiqu.eid.sdk.utils.Utilities.checkBiometricsSupported
|
|
28
|
-
import java.util.Arrays
|
|
29
|
-
import java.util.UUID
|
|
30
7
|
|
|
31
|
-
|
|
8
|
+
// Dummy implementation for licensed library
|
|
32
9
|
class UbiquKeyStorage(private val context: ReactApplicationContext) : NativeKeyStorage {
|
|
33
10
|
companion object {
|
|
34
|
-
private const val TAG = "ch.procivis.one.core.ubiqu.UbiquKeyStorage"
|
|
35
|
-
|
|
36
|
-
// Procivis secrets for Ubiqu
|
|
37
|
-
private const val CONFIG_FILE_CONTENT = "{" +
|
|
38
|
-
"\"id\": \"26c46847-152e-44e8-b73a-b7d4c51c7074\"," +
|
|
39
|
-
"\"version\": \"0\"," +
|
|
40
|
-
"\"content\": \"OJwoFNrtC73zg2andJ/ABXa6mM16ONVa8N4zDHcjjLUhI21KEV0bHsEiCjYJ0xOiBSEgKrGXQF8oTZfPS2gb7/ObFxRzFwacygL9m0TLVKYM3svK8CE+GF5pP/O+fVy6hvxQphsOTHbj0G7TT6Xd1v0YOCjyL7MMWz9nA8I07O0MGw+WjWds1Ecth7NyvazoOO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cbEFXEglwrYvLkXjpT275xiHqAMwoYm2/XFbcaVZWC7vO1ZEhp2K8prC/QUJzZr5hQhdeK+VvPkDH5E3PjOGMSZEPSP8F2zeVg4e0gLBYyHdG5MAe6o/No95ZEcolW1Tz+LoFfZy4WV3nJuOQ21CmsOZVBiv8iRHv/OVmD5PEob2l4ts9pmfDTJm1Td7clD/P7BElgjUlHq1Cc//3x112AHdiHgmxu4q1UHXnDVfOfzyMTQYtzVyyQma1hmFFOnHc2mXMnVPHsYKZ90qAHhIHYW8DWvuNqizfsoN55eb8nF4kOo9/XDAlN4syhHA3hIfyP61O+4W3AH8ReDTXcb2EEDNnZ/Q9sJfPxvmQkKPz0XnSTF9Bs+6mQsgt8GF74p53WAkcpM5U8PEn7GBjiTAQTRQBpMCQ/I9GmhOSpD1mzqdkG/ATBb8qYxUNV+703ChDqeBvryV3k8mlNBuouK9+0JDNbSF7qEpCPNg2f+IWiBr3jXy3JutguH+WnjeqNbk0AeZKCGP9tgF1dOHwcoymzC/mx3N38+kSlDopUEz4oWxzYpqjfYmHIQLW94QywRzfOHWYxISBAYZ8UQclk/BkMNwc9m6Y+pHmULRTs+1fU5NSTUoxXfI0SWkgt46459A==\"," +
|
|
41
|
-
"\"signature\": \"ijEe2xRd36VNR7WwAgDqBbt1jpvuqS/NJL6RG+w3x9gWImR/wm/7W3mCHTlEEJ6AS0md2hVZG1pKvZqApAG788xIeVSSDfuMYn57yCu8XPBVloQazGQu4xU9WjbocbKc5VNtu0Sb1us5tBsW1wJt8eQLaPErihEcQ9HW/EaXz1h5s4pKwed/bsuLtH1HdCulLMs1IKhJKuSWzjuaf2l9Tmg2Z354C2mPm8UnXX2TE77PVxCXegIic9U6tDOgelDgGLjKFLbZwkxpuK8kSRPnvSS/K8vkyl+5KxQEwNL6DC+glFWDwB3PpWi/reniqc5QzrBMUgsdMMoPTaWaXi9F8A==\"" +
|
|
42
|
-
"}"
|
|
43
|
-
private const val IDENTITY_SERVICE_URL = "https://api.identity.strongpin.ubiqu-sandbox.com"
|
|
44
|
-
private const val ORGANISATION_ID = "88e5fe80-106e-465c-a29d-1822d3790feb"
|
|
45
|
-
private const val TOKEN_GENERATOR_URL =
|
|
46
|
-
"https://api.token-generator.strongpin.ubiqu-sandbox.com/ubiqu/"
|
|
47
|
-
private const val API_KEY =
|
|
48
|
-
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwaS5pZGVudGl0eS5zdHJvbmdwaW4udWJpcXUtc2FuZGJveC5jb20iLCJpYXQiOjE3MzgzMzY2NTksImp0aSI6Ijc2NTY0M2FhLTI2NzgtNDFjZC04N2RiLThhODhmMzdjZDVhNSIsInNjb3BlIjoic2VydmljZV9hY2NvdW50Iiwic3ViIjoicHJvY2l2aXMtdGVzdCIsImF1ZCI6Imh0dHBzOi8vYXBpLnRva2VuLWdlbmVyYXRvci5zdHJvbmdwaW4udWJpcXUtc2FuZGJveC5jb20vdWJpcXUvIiwidG9rZW5fdHlwZSI6ImFwaV9rZXkifQ.RZtik0TlyoCd8M5BIKCsa0vQVols9eqB3QsvxPK-t5BvQO-v39VZoEQWahQCVQ2OKScEKX_EUeFiK0v1kzTLvKVGIIYuLYIBYJf6QQkc2MWroco54iDPMnK6_8J7EdRXdDhDH3-ukpzRrHwvOfAH50WGNco1U5QSqwvuwoWYWVANBZSBCSOMI4zYrNomEUbo04b-V10VjdHYMcpac14XxSNaxATSEliDVGv_JrAEOXSTs49ebGLT4OOdLHLoAfwu1NylpbvJQnhJYlpudzWf-46FM58uxCYs0DphYMtC6sC0XM1nhvcgli1ngzn-llSyaCQ1TY3PStU8RKxCtfa95A"
|
|
49
|
-
|
|
50
|
-
// ASN.1 prefix used for EdDSA public keys
|
|
51
|
-
private val EDDSA_PREFIX_ASN1 =
|
|
52
|
-
byteArrayOf(0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00)
|
|
53
|
-
|
|
54
|
-
@Volatile
|
|
55
11
|
var listenerCount = 0
|
|
56
12
|
}
|
|
57
13
|
|
|
58
14
|
// ==== NativeKeyStorage interface
|
|
59
15
|
override suspend fun generateKey(keyAlias: String): GeneratedKeyBindingDto {
|
|
60
|
-
|
|
61
|
-
ensureUbiquSDKInitialized()
|
|
62
|
-
|
|
63
|
-
// a locked asset can be left out if previous initialization failed,
|
|
64
|
-
// in such case start all over
|
|
65
|
-
if (UbqSdk.assets.isNotEmpty() && UbqSdk.assets[0].state != UbqAssetState.NORMAL) {
|
|
66
|
-
Log.w(TAG, "Invalid asset state: ${UbqSdk.assets[0].state.name}, resetting")
|
|
67
|
-
UbqSdk.reset()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (UbqSdk.assets.isEmpty()) {
|
|
71
|
-
val accessToken = TokenManager.getAccessToken()
|
|
72
|
-
val request = CreateIdentityRequest(UUID.randomUUID().toString())
|
|
73
|
-
val identityResponse = RegistrationManager.createIdentity(accessToken, request)
|
|
74
|
-
val rseResponse =
|
|
75
|
-
RegistrationManager.registerRse(accessToken, identityResponse.body()!!.sub)
|
|
76
|
-
createMainUbqAsset(rseResponse.body()!!)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
val asset = UbqSdk.assets[0]
|
|
80
|
-
val newKey = asset.createDerivedAsset(context, CryptoTypes.EdDSA_25519)
|
|
81
|
-
|
|
82
|
-
val keyContent = parsePemPubKeyContent(newKey.publicKey)
|
|
83
|
-
if (keyContent.size != 44) {
|
|
84
|
-
throw NativeKeyStorageException.KeyGenerationFailure("Invalid key length")
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
val prefix = Arrays.copyOfRange(keyContent, 0, 12)
|
|
88
|
-
if (!(EDDSA_PREFIX_ASN1 contentEquals prefix)) {
|
|
89
|
-
throw NativeKeyStorageException.KeyGenerationFailure("Invalid key prefix")
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
val publicKey = Arrays.copyOfRange(keyContent, 12, 44)
|
|
93
|
-
val keyReference = newKey.uuid.toString().toByteArray(Charsets.UTF_8)
|
|
94
|
-
return@exceptionWrapper GeneratedKeyBindingDto(keyReference, publicKey)
|
|
95
|
-
}
|
|
16
|
+
throw NativeKeyStorageException.Unsupported()
|
|
96
17
|
}
|
|
97
18
|
|
|
98
19
|
override suspend fun sign(keyReference: ByteArray, message: ByteArray): ByteArray {
|
|
99
|
-
|
|
100
|
-
val derivedAssetId = UUID.fromString(keyReference.toString(Charsets.UTF_8))
|
|
101
|
-
|
|
102
|
-
val key =
|
|
103
|
-
getMainUbqAsset().listDerivedAssets(context).find { it.uuid == derivedAssetId }
|
|
104
|
-
?: throw NativeKeyStorageException.SignatureFailure("Ubiqu key not found")
|
|
105
|
-
|
|
106
|
-
val signature = signWithUbqAsset(key, message)
|
|
107
|
-
?: throw NativeKeyStorageException.SignatureFailure("No signature provided")
|
|
108
|
-
|
|
109
|
-
return@exceptionWrapper Base64.decode(signature, Base64.DEFAULT)
|
|
110
|
-
}
|
|
20
|
+
throw NativeKeyStorageException.Unsupported()
|
|
111
21
|
}
|
|
112
22
|
|
|
113
23
|
override suspend fun generateAttestation(keyReference: ByteArray, nonce: String?): List<String> {
|
|
114
24
|
throw NativeKeyStorageException.Unsupported()
|
|
115
25
|
}
|
|
116
26
|
|
|
117
|
-
override suspend fun
|
|
27
|
+
override suspend fun generateAttestationKey(keyAlias: String, nonce: String?): GeneratedKeyBindingDto {
|
|
118
28
|
throw NativeKeyStorageException.Unsupported()
|
|
119
29
|
}
|
|
120
30
|
|
|
121
|
-
override suspend fun
|
|
31
|
+
override suspend fun signWithAttestationKey(keyReference: ByteArray, message: ByteArray): ByteArray {
|
|
122
32
|
throw NativeKeyStorageException.Unsupported()
|
|
123
33
|
}
|
|
124
34
|
|
|
125
35
|
// ==== public interface
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
val asset = getMainUbqAsset()
|
|
129
|
-
return@exceptionWrapper runOnUIThread { promise ->
|
|
130
|
-
asset.changePin(onStarted = {
|
|
131
|
-
startFlow(it, RequestType.CHANGE_PIN, promise)
|
|
132
|
-
}, onStartFailure = { e ->
|
|
133
|
-
promise.fail(e)
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
}
|
|
36
|
+
fun changePin(): String? {
|
|
37
|
+
throw NativeKeyStorageException.Unsupported()
|
|
137
38
|
}
|
|
138
39
|
|
|
139
40
|
fun getBiometricsSupported(): Boolean {
|
|
140
|
-
|
|
141
|
-
return@exceptionWrapper checkBiometricsSupported(context) && checkBiometricsAvailable(
|
|
142
|
-
context
|
|
143
|
-
)
|
|
144
|
-
}
|
|
41
|
+
throw NativeKeyStorageException.Unsupported()
|
|
145
42
|
}
|
|
146
43
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return@exceptionWrapper getMainUbqAsset().biometricsEnabled
|
|
150
|
-
}
|
|
44
|
+
fun getBiometricsEnabled(): Boolean {
|
|
45
|
+
throw NativeKeyStorageException.Unsupported()
|
|
151
46
|
}
|
|
152
47
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
val asset = getMainUbqAsset()
|
|
156
|
-
return@exceptionWrapper runOnUIThread { promise ->
|
|
157
|
-
val activity =
|
|
158
|
-
context.currentActivity as? AppCompatActivity
|
|
159
|
-
?: throw NativeKeyStorageException.Unknown("No activity")
|
|
160
|
-
asset.addBiometrics(activity, verifyBiometrics, onStarted = {
|
|
161
|
-
startFlow(it, RequestType.ADD_BIOMETRICS, promise)
|
|
162
|
-
}, onStartFailure = { e ->
|
|
163
|
-
promise.fail(e)
|
|
164
|
-
})
|
|
165
|
-
}
|
|
166
|
-
}
|
|
48
|
+
fun enableBiometrics(verifyBiometrics: Boolean): String? {
|
|
49
|
+
throw NativeKeyStorageException.Unsupported()
|
|
167
50
|
}
|
|
168
51
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
getMainUbqAsset().removeBiometrics()
|
|
172
|
-
}
|
|
52
|
+
fun disableBiometrics() {
|
|
53
|
+
throw NativeKeyStorageException.Unsupported()
|
|
173
54
|
}
|
|
174
55
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
ensureUbiquSDKInitialized()
|
|
178
|
-
UbqSdk.reset()
|
|
179
|
-
}
|
|
56
|
+
fun reset() {
|
|
57
|
+
throw NativeKeyStorageException.Unsupported()
|
|
180
58
|
}
|
|
181
59
|
|
|
182
60
|
fun resetPinFlow() {
|
|
183
|
-
|
|
184
|
-
cancelPinPadFlow()
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// ==== private methods
|
|
189
|
-
@Volatile
|
|
190
|
-
private var sdkInitialized = false
|
|
191
|
-
private suspend fun ensureUbiquSDKInitialized() {
|
|
192
|
-
if (sdkInitialized) return
|
|
193
|
-
return runOnUIThread { promise ->
|
|
194
|
-
val activity = context.currentActivity
|
|
195
|
-
?: throw NativeKeyStorageException.Unknown("No current activity")
|
|
196
|
-
|
|
197
|
-
UbqSdk.enableLogging(2)
|
|
198
|
-
|
|
199
|
-
val configFile = CONFIG_FILE_CONTENT.byteInputStream(Charsets.UTF_8)
|
|
200
|
-
UbqSdk.initialize(activity.application, configFile)
|
|
201
|
-
|
|
202
|
-
RegistrationManager.build(IDENTITY_SERVICE_URL, ORGANISATION_ID)
|
|
203
|
-
TokenManager.build(TOKEN_GENERATOR_URL, API_KEY)
|
|
204
|
-
|
|
205
|
-
sdkInitialized = true
|
|
206
|
-
promise.succeed(Unit)
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
private suspend fun createMainUbqAsset(rseResponse: RegisterRSEResponse): String? {
|
|
211
|
-
return runOnUIThread { promise ->
|
|
212
|
-
UbqSdk.subscribe(
|
|
213
|
-
rseResponse.nonce,
|
|
214
|
-
rseResponse.puk,
|
|
215
|
-
onStarted = {
|
|
216
|
-
startFlow(it, RequestType.SUBSCRIBE, promise)
|
|
217
|
-
},
|
|
218
|
-
onStartFailure = { e ->
|
|
219
|
-
promise.fail(e)
|
|
220
|
-
}
|
|
221
|
-
)
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
private suspend fun getMainUbqAsset(): UbqAsset {
|
|
226
|
-
ensureUbiquSDKInitialized()
|
|
227
|
-
|
|
228
|
-
if (UbqSdk.assets.isEmpty()) {
|
|
229
|
-
throw NativeKeyStorageException.Unknown("Ubiqu main asset missing")
|
|
230
|
-
}
|
|
231
|
-
val asset = UbqSdk.assets[0]
|
|
232
|
-
if (asset.state != UbqAssetState.NORMAL) {
|
|
233
|
-
throw NativeKeyStorageException.Unknown("Ubiqu main asset in wrong state: ${asset.state.name}")
|
|
234
|
-
}
|
|
235
|
-
return asset
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
@OptIn(ExperimentalStdlibApi::class)
|
|
239
|
-
private suspend fun signWithUbqAsset(key: UbqDerivedAsset, message: ByteArray): String? {
|
|
240
|
-
return asyncCallback { promise ->
|
|
241
|
-
val hexMessage = UnsignedData(message.toHexString())
|
|
242
|
-
key.use(context, hexMessage, onStarted = {
|
|
243
|
-
startFlow(it, RequestType.TRANSACTION, promise)
|
|
244
|
-
}, onStartFailure = { e ->
|
|
245
|
-
promise.fail(e)
|
|
246
|
-
})
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
private fun parsePemPubKeyContent(pem: String): ByteArray {
|
|
251
|
-
val base64Content = pem.split("\n").filter { part ->
|
|
252
|
-
part != "-----BEGIN PUBLIC KEY-----" && part != "-----END PUBLIC KEY-----"
|
|
253
|
-
}.joinToString(separator = "")
|
|
254
|
-
return Base64.decode(base64Content, Base64.DEFAULT)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
private fun startFlow(
|
|
258
|
-
flow: UbqRequestFlow,
|
|
259
|
-
requestType: RequestType,
|
|
260
|
-
promise: Util.Promise<String?>
|
|
261
|
-
) {
|
|
262
|
-
if (listenerCount == 0) {
|
|
263
|
-
promise.fail(NativeKeyStorageException.Unknown("No UI listeners"))
|
|
264
|
-
} else {
|
|
265
|
-
startPinPadFlow(context, flow, requestType, promise)
|
|
266
|
-
}
|
|
61
|
+
throw NativeKeyStorageException.Unsupported()
|
|
267
62
|
}
|
|
268
63
|
}
|
package/core-sdk.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"android": {
|
|
3
3
|
"debug": {
|
|
4
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
5
|
-
"sha1": "
|
|
4
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/81885/android/onecore-debug.aar",
|
|
5
|
+
"sha1": "c3d51c2d8d7fe33f2d96f3c86940eebaf9a4020f"
|
|
6
6
|
},
|
|
7
7
|
"release": {
|
|
8
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
9
|
-
"sha1": "
|
|
8
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/81885/android/onecore-release.aar",
|
|
9
|
+
"sha1": "89f8fe0cd515100fa9eb701128a140f3c3b535c8"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"ios": {
|
|
13
|
-
"url": "https://onesdk.blob.core.windows.net/core-sdk/
|
|
14
|
-
"sha1": "
|
|
13
|
+
"url": "https://onesdk.blob.core.windows.net/core-sdk/81885/ios/deploy.zip",
|
|
14
|
+
"sha1": "466211b3ff0189cd55462fc2175da099937bc2b7"
|
|
15
15
|
}
|
|
16
16
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { interfaceMethodNames } from "./src/core";
|
|
|
4
4
|
import * as ubiqu from "./src/ubiqu";
|
|
5
5
|
export * from "./src/core";
|
|
6
6
|
export * from "./src/error";
|
|
7
|
+
export * from "./src/nfc";
|
|
7
8
|
/** @hidden */
|
|
8
9
|
export const Ubiqu = ubiqu;
|
|
9
10
|
const ONE = NativeModules.ProcivisOneCoreModule;
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TrustEntityTypeBindingEnum } from "./one-core-uniffi-intf";
|
|
2
2
|
export declare enum KeyAlgorithmFeatureEnum {
|
|
3
3
|
GENERATE_CSR = "GENERATE_CSR"
|
|
4
4
|
}
|
|
@@ -132,7 +132,7 @@ export declare enum TrustOperation {
|
|
|
132
132
|
}
|
|
133
133
|
export interface TrustCapabilities {
|
|
134
134
|
operations: TrustOperation[];
|
|
135
|
-
supportedTypes:
|
|
135
|
+
supportedTypes: TrustEntityTypeBindingEnum[];
|
|
136
136
|
}
|
|
137
137
|
export interface Config {
|
|
138
138
|
format: ConfigEntities<FormatCapabilities>;
|
|
@@ -141,6 +141,7 @@ export interface Config {
|
|
|
141
141
|
transport: ConfigEntities;
|
|
142
142
|
revocation: ConfigEntities<RevocationCapabilities>;
|
|
143
143
|
did: ConfigEntities<DidCapabilities>;
|
|
144
|
+
identifier: ConfigEntities;
|
|
144
145
|
datatype: ConfigEntities<undefined, DataTypeParams>;
|
|
145
146
|
keyAlgorithm: ConfigEntities<KeyAlgorithmCapabilities, {}>;
|
|
146
147
|
keyStorage: ConfigEntities<KeyStorageCapabilities>;
|
package/dist/src/config.js
CHANGED
|
@@ -53,3 +53,8 @@ export var TrustOperation;
|
|
|
53
53
|
TrustOperation["Publish"] = "PUBLISH";
|
|
54
54
|
TrustOperation["Lookup"] = "LOOKUP";
|
|
55
55
|
})(TrustOperation || (TrustOperation = {}));
|
|
56
|
+
// Typescript automatic assertions to keep the fields of ONECore ConfigBindingDto and typed Config in sync
|
|
57
|
+
/** assert that all fields listed in {@link ConfigBindingDto} exist in {@link Config} */
|
|
58
|
+
const missingFieldsCheck = null;
|
|
59
|
+
/** assert that all fields listed in {@link Config} exist in {@link ConfigBindingDto} */
|
|
60
|
+
const extraFieldsCheck = null;
|
package/dist/src/core.d.ts
CHANGED
|
@@ -1,190 +1,13 @@
|
|
|
1
|
-
import { BackupCreate, ImportBackupMetadata, UnexportableEntities } from "./backup";
|
|
2
1
|
import { Config } from "./config";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { DidListItem, DidListQuery, DidRequest } from "./did";
|
|
6
|
-
import { HistoryListItem, HistoryListQuery } from "./history";
|
|
7
|
-
import { KeyRequest } from "./key";
|
|
8
|
-
import { ItemList } from "./list";
|
|
9
|
-
import { CreateProofRequest, InvitationResultProofRequest, PresentationDefinition, PresentationDefinitionRequestedCredential, PresentationDefinitionV2, PresentationSubmitCredentialRequest, PresentationSubmitV2CredentialRequest, ProofDetail, ProofListItem, ProofListQuery, ProposeProofRequest, ProposeProofResponse, ShareProofRequest, ShareProofResponse } from "./proof";
|
|
10
|
-
import { CreateProofSchemaRequest, ImportProofSchemaRequest, ProofSchema, ProofSchemaListItem, ProofSchemaListQuery, ShareProofSchemaResponse } from "./proofSchema";
|
|
11
|
-
import { CreateRemoteTrustEntityRequest, CreateTrustAnchorRequest, CreateTrustEntityRequest, RemoteTrustEntity, ResolvedIdentifierTrustEntity, ResolveTrustEntityByIdentifierRequest, TrustAnchor, TrustAnchorListItem, TrustAnchorListQuery, TrustEntity, TrustEntityListItem, TrustEntityListQuery, UpdateRemoteTrustEntityRequest } from "./trust";
|
|
12
|
-
import { CacheType } from "./cache";
|
|
13
|
-
import { CreateOrganisationRequest, UpsertOrganisationRequest } from "./organisation";
|
|
14
|
-
import { CreateIdentifierRequest, IdentifierDetail, IdentifierListItem, IdentifierListQuery } from "./identifier";
|
|
15
|
-
import { HolderRegisterWalletUnitRequest, HolderWalletUnitDetail } from "./walletUnit";
|
|
16
|
-
import { NfcScanRequest } from "./nfc";
|
|
17
|
-
export * from "./backup";
|
|
18
|
-
export * from "./cache";
|
|
2
|
+
import { OneCoreBinding } from "./one-core-uniffi-intf";
|
|
3
|
+
export * from "./one-core-uniffi-intf";
|
|
19
4
|
export * from "./config";
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
export * from "./did";
|
|
23
|
-
export * from "./identifier";
|
|
24
|
-
export * from "./history";
|
|
25
|
-
export * from "./key";
|
|
26
|
-
export * from "./nfc";
|
|
27
|
-
export * from "./list";
|
|
28
|
-
export * from "./organisation";
|
|
29
|
-
export * from "./proof";
|
|
30
|
-
export * from "./proofSchema";
|
|
31
|
-
export * from "./trust";
|
|
32
|
-
export * from "./walletUnit";
|
|
33
|
-
export interface Version {
|
|
34
|
-
target: string;
|
|
35
|
-
buildTime: string;
|
|
36
|
-
branch: string;
|
|
37
|
-
tag: string;
|
|
38
|
-
commit: string;
|
|
39
|
-
rustVersion: string;
|
|
40
|
-
pipelineId: string;
|
|
41
|
-
}
|
|
42
|
-
export type InvitationResult = InvitationResultCredentialIssuance | InvitationResultProofRequest | AuthorizationCodeFlow;
|
|
43
|
-
export interface HandleInvitationRequest {
|
|
44
|
-
/** Typically encoded as a QR code or deep link by the issuer or
|
|
45
|
-
* verifier. For example:
|
|
46
|
-
* "https://example.com/credential-offer" */
|
|
47
|
-
url: string;
|
|
48
|
-
organisationId: string;
|
|
49
|
-
/** For configurations with multiple transport protocols enabled
|
|
50
|
-
* you can specify which one to use for this interaction. */
|
|
51
|
-
transport?: string[];
|
|
52
|
-
/** For issuer-initiated Authorization Code Flows, provide the
|
|
53
|
-
* authorization server with the URI it should return the user
|
|
54
|
-
* to once authorization is complete. For example:
|
|
55
|
-
* "myapp://example". */
|
|
56
|
-
redirectUri?: string;
|
|
57
|
-
}
|
|
58
|
-
export interface ResolveJsonLdContextResponse {
|
|
59
|
-
context: string;
|
|
60
|
-
}
|
|
61
|
-
export interface ONECore {
|
|
62
|
-
getVersion(): Promise<Version>;
|
|
5
|
+
export interface ONECore extends Omit<OneCoreBinding, "version" | "getConfig"> {
|
|
6
|
+
getVersion(): Promise<ReturnType<OneCoreBinding["version"]>>;
|
|
63
7
|
getConfig(): Promise<Config>;
|
|
64
|
-
createOrganisation(request: CreateOrganisationRequest): Promise<string>;
|
|
65
|
-
upsertOrganisation(request: UpsertOrganisationRequest): Promise<void>;
|
|
66
|
-
generateKey(keyRequest: KeyRequest): Promise<string>;
|
|
67
|
-
createDid(didRequest: DidRequest): Promise<string>;
|
|
68
|
-
getDids(query: DidListQuery): Promise<ItemList<DidListItem>>;
|
|
69
|
-
createIdentifier(identifierRequest: CreateIdentifierRequest): Promise<string>;
|
|
70
|
-
getIdentifiers(query: IdentifierListQuery): Promise<ItemList<IdentifierListItem>>;
|
|
71
|
-
getIdentifier(identifierId: IdentifierListItem["id"]): Promise<IdentifierDetail>;
|
|
72
|
-
deleteIdentifier(identifierId: IdentifierListItem["id"]): Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* For a wallet, handles the interaction once the wallet connects to a share
|
|
75
|
-
* endpoint URL (for example, scans the QR code of an offered credential or
|
|
76
|
-
* request for proof).
|
|
77
|
-
*/
|
|
78
|
-
handleInvitation(request: HandleInvitationRequest): Promise<InvitationResult>;
|
|
79
|
-
holderAcceptCredential(request: HolderAcceptCredentialRequest): Promise<CredentialDetail["id"]>;
|
|
80
|
-
holderRejectCredential(interactionId: InvitationResultCredentialIssuance["interactionId"]): Promise<void>;
|
|
81
|
-
/** For wallets, starts the OID4VCI Authorization Code Flow. */
|
|
82
|
-
initiateIssuance(request: InitiateIssuanceRequest): Promise<InitiateIssuanceResponse>;
|
|
83
|
-
/** For wallet-initiated flows, continues the OpenID4VCI issuance process
|
|
84
|
-
* after completing authorization.
|
|
85
|
-
*/
|
|
86
|
-
continueIssuance(
|
|
87
|
-
/** Starts with the `redirectUri` and is used to continue the Authorization
|
|
88
|
-
* Code Flow issuance process. For example:
|
|
89
|
-
* "myapp://example/credential-offer?code=xxx&clientId=myWallet&..." */
|
|
90
|
-
url: string): Promise<ContinueIssuanceResponse>;
|
|
91
|
-
getPresentationDefinition(proofId: ProofDetail["id"]): Promise<PresentationDefinition>;
|
|
92
|
-
getPresentationDefinitionV2(proofId: ProofDetail["id"]): Promise<PresentationDefinitionV2>;
|
|
93
|
-
holderRejectProof(interactionId: InvitationResultProofRequest["interactionId"]): Promise<void>;
|
|
94
|
-
holderSubmitProof(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<PresentationDefinitionRequestedCredential["id"], PresentationSubmitCredentialRequest | PresentationSubmitCredentialRequest[]>): Promise<void>;
|
|
95
|
-
holderSubmitProofV2(interactionId: InvitationResultProofRequest["interactionId"], credentials: Record<string, PresentationSubmitV2CredentialRequest | PresentationSubmitV2CredentialRequest[]>): Promise<void>;
|
|
96
|
-
getCredentials(query: CredentialListQuery): Promise<ItemList<CredentialListItem>>;
|
|
97
|
-
runTask(task: string): Promise<string>;
|
|
98
|
-
deleteProofClaims(proofId: ProofDetail["id"]): Promise<void>;
|
|
99
|
-
getCredential(credentialId: CredentialListItem["id"]): Promise<CredentialDetail>;
|
|
100
|
-
deleteCredential(credentialId: CredentialListItem["id"]): Promise<void>;
|
|
101
|
-
importCredentialSchema(request: ImportCredentialSchemaRequest): Promise<CredentialSchema["id"]>;
|
|
102
|
-
getCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<CredentialSchemaDetail>;
|
|
103
|
-
getCredentialSchemas(query: CredentialSchemaListQuery): Promise<ItemList<CredentialSchema>>;
|
|
104
|
-
deleteCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<void>;
|
|
105
|
-
/** For verifiers, creates a proof request. */
|
|
106
|
-
createProof(request: CreateProofRequest): Promise<ProofDetail["id"]>;
|
|
107
|
-
shareProof(proofId: ProofDetail["id"], request: ShareProofRequest): Promise<ShareProofResponse>;
|
|
108
|
-
shareProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ShareProofSchemaResponse>;
|
|
109
|
-
shareCredentialSchema(credentialSchemaId: CredentialSchema["id"]): Promise<ShareCredentialSchemaResponse>;
|
|
110
|
-
getProof(proofId: ProofDetail["id"]): Promise<ProofDetail>;
|
|
111
|
-
getProofs(query: ProofListQuery): Promise<ItemList<ProofListItem>>;
|
|
112
|
-
deleteProof(proofId: ProofDetail["id"]): Promise<void>;
|
|
113
|
-
/** For wallets, initiates device engagement for offline flows.
|
|
114
|
-
* Reference the `verificationEngagement` entry of your configuration
|
|
115
|
-
* for your options for `engagement`.
|
|
116
|
-
*/
|
|
117
|
-
proposeProof(request: ProposeProofRequest): Promise<ProposeProofResponse>;
|
|
118
|
-
createProofSchema(request: CreateProofSchemaRequest): Promise<ProofSchema["id"]>;
|
|
119
|
-
getProofSchemas(query: ProofSchemaListQuery): Promise<ItemList<ProofSchemaListItem>>;
|
|
120
|
-
getProofSchema(proofSchemaId: ProofSchema["id"]): Promise<ProofSchema>;
|
|
121
|
-
deleteProofSchema(proofSchemaId: ProofSchema["id"]): Promise<void>;
|
|
122
|
-
importProofSchema(request: ImportProofSchemaRequest): Promise<ProofSchema["id"]>;
|
|
123
|
-
checkRevocation(credentialIds: Array<CredentialListItem["id"]>, forceRefresh: boolean): Promise<CredentialRevocationCheckResponse[]>;
|
|
124
|
-
createTrustAnchor(request: CreateTrustAnchorRequest): Promise<TrustAnchor["id"]>;
|
|
125
|
-
deleteTrustAnchor(trustAnchorId: TrustAnchor["id"]): Promise<void>;
|
|
126
|
-
getTrustAnchor(trustAnchorId: TrustAnchor["id"]): Promise<TrustAnchor>;
|
|
127
|
-
getTrustAnchors(query: TrustAnchorListQuery): Promise<ItemList<TrustAnchorListItem>>;
|
|
128
|
-
createTrustEntity(request: CreateTrustEntityRequest): Promise<TrustEntity["id"]>;
|
|
129
|
-
getTrustEntity(trustEntityId: TrustEntityListItem["id"]): Promise<TrustEntity>;
|
|
130
|
-
getTrustEntities(query: TrustEntityListQuery): Promise<ItemList<TrustEntityListItem>>;
|
|
131
|
-
getTrustEntityByDid(didId: DidListItem["id"]): Promise<TrustEntity>;
|
|
132
|
-
resolveTrustEntityByIdentifier(request: ResolveTrustEntityByIdentifierRequest): Promise<Record<IdentifierListItem["id"], ResolvedIdentifierTrustEntity[]>>;
|
|
133
|
-
createRemoteTrustEntity(request: CreateRemoteTrustEntityRequest): Promise<RemoteTrustEntity["id"]>;
|
|
134
|
-
getRemoteTrustEntity(didId: DidListItem["id"]): Promise<RemoteTrustEntity>;
|
|
135
|
-
updateRemoteTrustEntity(request: UpdateRemoteTrustEntityRequest): Promise<void>;
|
|
136
|
-
getHistory(query: HistoryListQuery): Promise<ItemList<HistoryListItem>>;
|
|
137
|
-
getHistoryEntry(historyId: HistoryListItem["id"]): Promise<HistoryListItem>;
|
|
138
|
-
createBackup(password: string, outputPath: string): Promise<BackupCreate>;
|
|
139
|
-
backupInfo(): Promise<UnexportableEntities>;
|
|
140
|
-
deleteCache(types: CacheType[] | undefined): Promise<void>;
|
|
141
|
-
/**
|
|
142
|
-
* Start import procedure
|
|
143
|
-
*
|
|
144
|
-
* This call will open the provided backup file, other subsequent function calls like {@link getCredentials} will return data from the imported package
|
|
145
|
-
* After this successful call, either {@link finalizeImport} (to persist the changes) or {@link rollbackImport} (to revert to old data) must be called
|
|
146
|
-
* @param {string} password User password matching selected during creation of the backup file
|
|
147
|
-
* @param {string} inputPath Path to the stored backup file
|
|
148
|
-
*/
|
|
149
|
-
unpackBackup(password: string, inputPath: string): Promise<ImportBackupMetadata>;
|
|
150
|
-
/**
|
|
151
|
-
* Persist unpacked backup
|
|
152
|
-
*
|
|
153
|
-
* This call will delete/overwrite the previously stored entries
|
|
154
|
-
*/
|
|
155
|
-
finalizeImport(): Promise<void>;
|
|
156
|
-
/**
|
|
157
|
-
* Close unpacked backup
|
|
158
|
-
*
|
|
159
|
-
* This call will restore the old entries prior calling {@link unpackBackup}
|
|
160
|
-
*/
|
|
161
|
-
rollbackImport(): Promise<void>;
|
|
162
|
-
resolveJsonldContext(url: string): Promise<ResolveJsonLdContextResponse>;
|
|
163
|
-
holderRegisterWalletUnit(request: HolderRegisterWalletUnitRequest): Promise<HolderWalletUnitDetail["id"]>;
|
|
164
|
-
holderWalletUnitStatus(walletUnitId: HolderWalletUnitDetail["id"]): Promise<void>;
|
|
165
|
-
holderGetWalletUnit(walletUnitId: HolderWalletUnitDetail["id"]): Promise<HolderWalletUnitDetail>;
|
|
166
|
-
/**
|
|
167
|
-
* Start scanning for ISO 18013-5 NFC engagement
|
|
168
|
-
*
|
|
169
|
-
* @param {NfcScanRequest} request system overlay messages to be displayed (iOS only)
|
|
170
|
-
* @returns {string} encoded NFC engagement to be used for {@link CreateProofRequest.isoMdlEngagement}
|
|
171
|
-
*/
|
|
172
|
-
nfcReadIsoMdlEngagement(request: NfcScanRequest): Promise<string>;
|
|
173
|
-
/**
|
|
174
|
-
* Explicitly stop scan started via {@link nfcReadIsoMdlEngagement}
|
|
175
|
-
*/
|
|
176
|
-
nfcStopIsoMdlEngagement(): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Uninitialize the core instance
|
|
179
|
-
*
|
|
180
|
-
* Any following calls on this instance will fail.
|
|
181
|
-
* A new core instance has to be initialized after.
|
|
182
|
-
* @param {boolean} deleteData If true, also delete all data from the DB, otherwise data will be persisted for the next core instance
|
|
183
|
-
*/
|
|
184
|
-
uninitialize(deleteData: boolean): Promise<void>;
|
|
185
8
|
}
|
|
186
9
|
/**
|
|
187
10
|
* @hidden
|
|
188
11
|
* New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
|
|
189
12
|
*/
|
|
190
|
-
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "
|
|
13
|
+
export declare const interfaceMethodNames: readonly ["getVersion", "getConfig", "createOrganisation", "upsertOrganisation", "generateKey", "createDid", "getDids", "createIdentifier", "getIdentifier", "listIdentifiers", "deleteIdentifier", "handleInvitation", "holderAcceptCredential", "holderRejectCredential", "initiateIssuance", "continueIssuance", "getPresentationDefinition", "getPresentationDefinitionV2", "holderRejectProof", "holderSubmitProof", "holderSubmitProofV2", "getCredentials", "runTask", "deleteProofClaims", "getCredential", "deleteCredential", "importCredentialSchema", "getCredentialSchema", "getCredentialSchemas", "deleteCredentialSchema", "createProof", "shareProof", "shareProofSchema", "shareCredentialSchema", "getProof", "getProofs", "deleteProof", "proposeProof", "createProofSchema", "getProofSchemas", "getProofSchema", "deleteProofSchema", "importProofSchema", "checkRevocation", "createTrustAnchor", "deleteTrustAnchor", "getTrustAnchor", "listTrustAnchors", "createTrustEntity", "getTrustEntity", "listTrustEntities", "getTrustEntityByDid", "resolveTrustEntityByIdentifier", "createRemoteTrustEntity", "getRemoteTrustEntity", "updateRemoteTrustEntity", "getHistoryList", "getHistoryEntry", "createBackup", "backupInfo", "deleteCache", "unpackBackup", "finalizeImport", "rollbackImport", "resolveJsonldContext", "holderRegisterWalletUnit", "holderWalletUnitStatus", "holderGetWalletUnit", "nfcReadIsoMdlEngagement", "nfcStopIsoMdlEngagement", "uninitialize"];
|
package/dist/src/core.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./cache";
|
|
1
|
+
export * from "./one-core-uniffi-intf";
|
|
3
2
|
export * from "./config";
|
|
4
|
-
export * from "./credential";
|
|
5
|
-
export * from "./credentialSchema";
|
|
6
|
-
export * from "./did";
|
|
7
|
-
export * from "./identifier";
|
|
8
|
-
export * from "./history";
|
|
9
|
-
export * from "./key";
|
|
10
|
-
export * from "./nfc";
|
|
11
|
-
export * from "./list";
|
|
12
|
-
export * from "./organisation";
|
|
13
|
-
export * from "./proof";
|
|
14
|
-
export * from "./proofSchema";
|
|
15
|
-
export * from "./trust";
|
|
16
|
-
export * from "./walletUnit";
|
|
17
3
|
/**
|
|
18
4
|
* @hidden
|
|
19
5
|
* New Architecture bridgeless issue workaround: see https://github.com/facebook/react-native/issues/43221
|
|
@@ -28,7 +14,7 @@ export const interfaceMethodNames = [
|
|
|
28
14
|
"getDids",
|
|
29
15
|
"createIdentifier",
|
|
30
16
|
"getIdentifier",
|
|
31
|
-
"
|
|
17
|
+
"listIdentifiers",
|
|
32
18
|
"deleteIdentifier",
|
|
33
19
|
"handleInvitation",
|
|
34
20
|
"holderAcceptCredential",
|
|
@@ -66,16 +52,16 @@ export const interfaceMethodNames = [
|
|
|
66
52
|
"createTrustAnchor",
|
|
67
53
|
"deleteTrustAnchor",
|
|
68
54
|
"getTrustAnchor",
|
|
69
|
-
"
|
|
55
|
+
"listTrustAnchors",
|
|
70
56
|
"createTrustEntity",
|
|
71
57
|
"getTrustEntity",
|
|
72
|
-
"
|
|
58
|
+
"listTrustEntities",
|
|
73
59
|
"getTrustEntityByDid",
|
|
74
60
|
"resolveTrustEntityByIdentifier",
|
|
75
61
|
"createRemoteTrustEntity",
|
|
76
62
|
"getRemoteTrustEntity",
|
|
77
63
|
"updateRemoteTrustEntity",
|
|
78
|
-
"
|
|
64
|
+
"getHistoryList",
|
|
79
65
|
"getHistoryEntry",
|
|
80
66
|
"createBackup",
|
|
81
67
|
"backupInfo",
|