Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3458e73
add scripts that set up didkit and install required dependencies for …
SametSahin10 Aug 16, 2022
30c10b4
add did field into UserState to store the DID
SametSahin10 Aug 18, 2022
25f87a7
add the default DID method
SametSahin10 Aug 18, 2022
bbb0a1d
add instructions to install android dependencies for Debian based GNU…
SametSahin10 Aug 18, 2022
51da473
add generatePrivateKey method that generates a private key from mnemo…
SametSahin10 Aug 18, 2022
a28e225
add packages required for DID generation
SametSahin10 Aug 18, 2022
dd8f82b
test if the same private key is generated when the same mnemonic is used
SametSahin10 Aug 18, 2022
6321572
when local account is created or a wallet is restored, generate a DID…
SametSahin10 Aug 18, 2022
c1bb5b9
on SplashScreen, if mnemonic exists, generate a DID for user
SametSahin10 Aug 18, 2022
2cdbdcd
create a class called DIDService and put generateDID function into it
SametSahin10 Aug 24, 2022
6d5bb80
add model classes required to issue a VC for the user
SametSahin10 Aug 24, 2022
78969c7
add uuid package
SametSahin10 Aug 26, 2022
1da2ab1
provide "ES256K" for "alg" since did:key method is used for current D…
SametSahin10 Aug 26, 2022
5c5837a
add privateKeyForDID and userInfoVC fields, remove the "ignore" annot…
SametSahin10 Aug 26, 2022
b38cecf
add test that checks if the DIDKit is available in tests by getting t…
SametSahin10 Aug 26, 2022
7956b64
add model classes required to issue and verify a VC
SametSahin10 Aug 26, 2022
84a0400
issue and verify a VC for the user
SametSahin10 Aug 26, 2022
bbdb3d4
change the value of "alg" of the expected private key to "ES256K"
SametSahin10 Aug 26, 2022
d2d2a64
in issueUserInfoVCCall action function, accept did as argument instea…
SametSahin10 Aug 27, 2022
cb6acad
remove unused import
SametSahin10 Aug 27, 2022
42710f5
dispatch a generateDIDCall in createLocalAccountCall and restoreWalle…
SametSahin10 Aug 27, 2022
5f9e991
generate a route for VerifyVerifiableCredentialPage
SametSahin10 Aug 27, 2022
6950cc3
add a MenuTile to for navigate to VerifyVerifiableCredentialPage
SametSahin10 Aug 27, 2022
4215e59
add riverpod package
SametSahin10 Aug 27, 2022
85eaad4
create a separate StatelessWidget for Verify Credential menu tile
SametSahin10 Aug 27, 2022
67b922c
rename VerifyVerifiableCredentialPage to VerifyCredentialPage
SametSahin10 Aug 27, 2022
8521be7
use the word "credential" instead of "VC"
SametSahin10 Aug 27, 2022
d23b3a6
add privateKeyForDID field into AccountViewModel
SametSahin10 Aug 27, 2022
4249f1e
design and implement a page where the JSON representation of a Verifi…
SametSahin10 Aug 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions didkit_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env bash

if [[ "$*" != *-android* ]] && [[ "$*" != *-ios* ]]; then
echo -e "\033[0;31mAt least one of the following arguments are required to build didkit:\033[0m
\033[0;36m-android\033[0m: builds didkit's Android binaries
\033[0;36m-ios\033[0m: builds didkit's iOS binaries
"
exit
fi

if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Checking for brew installation."
if ! command -v brew &>/dev/null; then
echo -e "\033[0;Could not find brew, please install brew or add it to path.\033[0m"
exit
fi
fi

echo "Checking for rustup installation and setting rust to nightly."
if ! command -v rustup &>/dev/null; then
if ! command -v curl &>/dev/null; then
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install curl
else
sudo apt install curl -yet
fi
fi

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default nightly
fi

if [[ "$*" == *-android* ]]; then
echo "Checking for java installation."

if ! command -v javac &>/dev/null; then
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install openjdk
else
sudo apt install default-jdk
fi
fi
fi

echo "Cloning DIDKit repo if not yet on previous directory"
[ ! -d "../didkit" ] && git clone https://github.com/spruceid/didkit.git ../didkit

echo "Cloning SSI repo if not yet on previous directory"
[ ! -d "../ssi" ] && git clone https://github.com/spruceid/ssi.git --recurse-submodules ../ssi

if [[ "$*" == *-android* ]]; then
echo "Checking for android sdk."
[ ! -d "$ANDROID_SDK_ROOT" ] && echo -e "\033[0;31mFailed to find Android SDK\033[0m" && exit
[ ! -d "$ANDROID_SDK_ROOT/build-tools" ] && [ ! -d "$ANDROID_TOOLS" ] && echo -e "\033[0;31mFailed to find android-tools\033[0m" && exit
[ ! -d "$ANDROID_SDK_ROOT/ndk" ] && [ ! -d "$ANDROID_NDK_HOME" ] && echo -e "\033[0;31mFailed to find Android NDK\033[0m" && exit
fi

if ! command -v flutter &>/dev/null; then
echo -e "\033[0;Could not find Flutter, please install flutter or add to path.\033[0m"
exit
fi

flutter channel dev
flutter upgrade

if [[ "$*" == *-android* ]]; then
flutter doctor --android-licenses
fi

cd ../didkit

if [[ "$*" == *-android* ]]; then
echo "Build didkit for Android"
make -C lib install-rustup-android
make -C lib ../target/test/aar.stamp
fi

if [[ "$*" == *-ios* ]]; then
echo "Build didkit for iOS"
make -C lib install-rustup-ios
make -C lib ../target/test/ios.stamp
fi

cargo build
50 changes: 50 additions & 0 deletions install_android_dependencies_for_debian_based_gnu_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash

## DEPENDENCIES
sudo apt update
sudo apt upgrade
sudo apt install -y git lib32z1 libssl-dev pkg-config build-essential curl cmake openjdk-11-jdk zip unzip
# if there are any error loading the above, re-run apt update and address them before continuing!
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

##CLONE SPRUCE REPOSITORIES
git clone https://github.com/spruceid/didkit
git clone https://github.com/spruceid/credible
git clone --recursive https://github.com/spruceid/ssi

##FLUTTER
flutter channel stable

##ANDROID SDK AND NDK
cd $HOME
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
unzip commandlinetools-linux-6200805_latest.zip -d Android/cmdline-tools
rm commandlinetools-linux-6200805_latest.zip
echo 'export ANDROID_SDK_ROOT=$HOME/Android' >> $HOME/.bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64' >> $HOME/.bashrc
echo 'export PATH=$ANDROID_SDK_ROOT/cmdline-tools/tools/bin:"$PATH"' >> $HOME/.bashrc
echo 'export PATH=$ANDROID_SDK_ROOT/cmdline-tools/tools/lib:"$PATH"' >> $HOME/.bashrc
echo 'export PATH=$ANDROID_SDK_ROOT/tools:"$PATH"' >> $HOME/.bashrc
echo 'export PATH=$JAVA_HOME/bin:"$PATH"' >> $HOME/.bashrc
. $HOME/.bashrc
sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "system-images;android-29;google_apis;x86" "system-images;android-29;google_apis;x86_64" "platform-tools" "platforms;android-29" "build-tools;29.0.3" "ndk;22.0.7026061" "cmdline-tools;latest"
sdkmanager --licenses

##ANDROID EMULATOR
curl -s "https://get.sdkman.io" | bash
. .sdkman/bin/sdkman-init.sh
sdk install gradle 6.5.1
echo "no" | avdmanager --verbose create avd --force --name "generic_10" --package "system-images;android-29;google_apis;x86" --tag "google_apis" --abi "x86"

##BUILD DIDKIT
printf "You are now ready to run the following commands, but re-loading bash/OS may be necessary.
If rustup is inaccessible, reboot/re-load bash.
$ cd didkit
$ make -C lib install-rustup-android
$ make -C lib ../target/test/java.stamp
$ make -C lib ../target/test/aar.stamp
$ make -C lib ../target/test/flutter.stamp
$ cargo build\n\n"
Loading