Giter Site home page Giter Site logo

elastos.did.swift.sdk's Introduction

Elastos.DID.Swift.SDK

Introduction

Elastos DID (Decentralized Identifier) Swift framework is a set of Swift APIs for Elastos DID used by dApps on iOS/macOS platforms, where Elastos DID is the DID system of Elastos ecosystem with compatibility to W3C DIDs specs.

Decentralized Identifiers (DIDs) are a new type of identifier for verifiable, decentralized digital identity. These new identifiers are designed to enable the controller of a DID to prove control over it and to be implemented independently of any centralized registry, identity provider, or certificate authority. DIDs are URLs that relate a DID subject to means for trustable interactions with that subject. DIDs resolve to DID Documents — simple documents that describe how to use that specific DID. Each DID Document may express cryptographic material, verification methods, and/or service endpoints. These provide a set of mechanisms which enable a DID controller to prove control of the DID. Service endpoints enable trusted interactions with the DID subject.

https://w3c-ccg.github.io/did-spec/

Build from source

Use the following commands to download and build source code:

$ git clone https://github.com/elastos/Elastos.DID.Swift.SDK.git
$ cd Elastos.DID.Swift.SDK
$ pod install
$ open -a Xcode ElastosDIDSDK.xcworkspace

1. Build DID NDK

Before to build the whole workspace, native library distributions targeting at iPhone device should be built from DID native repository with following commands on macOS:

$ git clone https://github.com/elastos/Elastos.DID.Native.SDK.git
$ cd Elastos.DID.Native.SDK/build
$ mkdir -p iphoneos
$ cd iphoneos
$ cmake -DHDKEY_ONLY=ON \
        -DIOS_PLATFORM="iphoneos" \
        -DCMAKE_TOOLCHAIN_FILE=../../cmake/iOSToolchain.cmake \
        ../..
$ make install

Where you also can use iphonesimulator option to build for iPhone simulator under new directory with appropriate name:

$ cd Elastos.DID.Native.SDK/build
$ mkdir -p iphonesimulator
$ cd iphoneosimulator
$ cmake -DHDKEY_ONLY=ON \
        -DIOS_PLATFORM="iphonesimulator" \
        -DCMAKE_TOOLCHAIN_FILE=../../cmake/iOSToolchain.cmake \
        ../..
$ make install

Please notice that only the architectures of x86-64 (simulator) and amd64 (device) are supported.

2. Import DID NDK

The directory "Externals/HDKey" would rely on native shared libraries built from the upper steps and should have the following directory structure:

Externals/HDKey
   |--include
       |-- crypto.h
       |-- HDkey.h
       |-- CHDKey.swift
   |--libs
       |--PLACEHOLDER.md
       (Please read the PLACEHOLDER.md)

Then follow the instruction of PLACEHOLDER.md, and import native headers and libraries with the specific locations.

3. Build DID SDK

Once all native dependencies are ready, use Apple Xcode to open the workspace and build for Swift DID SDK.

4. Output

Use Apple Xcode to generate ElastosDIDSDK.framework.

Tests

1. Import DID NDK

The directory "Externals/SPVWrapper/SPVWrapper" to import native shared libraries and headers should have following directory structure:

Externals/SPVWrapper/SPVWrapper
   |--include
       |--spvadapter.h
       |--CSPVWrapper.swift
   |--libs
       |-- PLACEHOLDER.md
       (Please read the PLACEHOLDER.md)

2. run unit tests

After importing dependencies from DID native, you can run unit tests.

Usage

COMING SOON

Build Docs

COMING SOON

Thanks

Sincerely thanks to all teams and projects that we rely on directly or indirectly.

Contributing

Welcome contributions to the Elastos DID SDK in many forms.

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.