From b27f3aef4a83a8908d6c4afd6ab4768c325ace74 Mon Sep 17 00:00:00 2001 From: Monobikash Das Date: Fri, 9 Dec 2022 17:37:22 +0530 Subject: [PATCH] VC binding initial commit --- android/build.gradle | 2 +- components/VcDetails.strings.json | 4 + components/VcDetails.tsx | 35 +++- components/VcItem.tsx | 68 ++++++- locales/ara.json | 6 +- locales/en.json | 4 + locales/fil.json | 6 +- locales/hin.json | 6 +- locales/kan.json | 6 +- locales/tam.json | 6 +- machines/vcItem.ts | 198 ++++++++++++++++++- machines/vcItem.typegen.ts | 256 +++++++++---------------- package-lock.json | 22 +++ package.json | 2 + screens/Home/MyVcs/BindVcController.ts | 69 +++++++ screens/Home/MyVcs/BindVcStatus.tsx | 55 ++++++ screens/Home/ViewVcModal.tsx | 33 +++- screens/Home/ViewVcModalController.ts | 19 ++ screens/Request/ReceiveVcScreen.tsx | 2 +- shared/keystore/SecureKeystore.ts | 13 ++ shared/rsakeypair/rsaKeypair.ts | 5 + types/vc.ts | 1 + 22 files changed, 638 insertions(+), 180 deletions(-) create mode 100644 screens/Home/MyVcs/BindVcController.ts create mode 100644 screens/Home/MyVcs/BindVcStatus.tsx create mode 100644 shared/keystore/SecureKeystore.ts create mode 100644 shared/rsakeypair/rsaKeypair.ts diff --git a/android/build.gradle b/android/build.gradle index b3ed68a7..2b0eed4c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,7 +3,7 @@ buildscript { ext { buildToolsVersion = "29.0.3" - minSdkVersion = 21 + minSdkVersion = 23 compileSdkVersion = 30 targetSdkVersion = 30 } diff --git a/components/VcDetails.strings.json b/components/VcDetails.strings.json index 78d789ae..5586a01a 100644 --- a/components/VcDetails.strings.json +++ b/components/VcDetails.strings.json @@ -14,5 +14,9 @@ "id": "Id", "nationalCard": "National Card", "uin": "UIN", + "enableVerification": "Enable Verification", + "profileAuthenticated": "Profile is authenticated!", + "offlineAuthDisabledHeader": "Offline Authentication disabled!", + "offlineAuthDisabledMessage": "Click 'Enable Authentication' to enable this credentials to be used for offline authentication.", "vid": "VID" } \ No newline at end of file diff --git a/components/VcDetails.tsx b/components/VcDetails.tsx index 56b491fc..d1317923 100644 --- a/components/VcDetails.tsx +++ b/components/VcDetails.tsx @@ -2,10 +2,10 @@ import { formatDistanceToNow } from 'date-fns'; import React from 'react'; import * as DateFnsLocale from '../lib/date-fns/locale'; import { useTranslation } from 'react-i18next'; -import { Image, ImageBackground } from 'react-native'; +import { Image, ImageBackground, View } from 'react-native'; import { Icon } from 'react-native-elements'; import { VC, CredentialSubject, LocalizedField } from '../types/vc'; -import { Column, Row, Text } from './ui'; +import { Button, Column, Row, Text } from './ui'; import { Theme } from './ui/styleUtils'; import { TextItem } from './ui/TextItem'; import { VcItemTags } from './VcItemTags'; @@ -271,12 +271,43 @@ export const VcDetails: React.FC = (props) => { text={reason.message} /> ))} + + {props.isBindingPending && ( + + + + + {t('offlineAuthDisabledHeader')} + + + {t('offlineAuthDisabledMessage')} + + +