wallet-sdk-gomobile

module
v0.0.0-...-6ffe938 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2025 License: Apache-2.0

README

Wallet SDK Gomobile

This package contains the gomobile-compatible version of the SDK. It acts as a wrapper for the Go SDK.

Prerequisites

  • Go 1.23 or newer
  • The gomobile tools:
    go install golang.org/x/mobile/cmd/gomobile@latest
    gomobile init
    
  • $GOPATH/bin added to your path
Android Bindings
iOS Bindings
  • A Mac
  • Xcode Command Line Tools - these are included with Xcode, but can also be installed standalone with xcode-select --install
  • Agreed to the Xcode licence agreement prompt via Terminal. Creating the iOS bindings will trigger the prompt if you haven't agreed to the licence yet

Generating the Bindings

To generate both the Android and iOS bindings in one command:

make generate-all-bindings

To generate only the Android bindings:

make generate-android-bindings

To generate only the iOS bindings:

make generate-ios-bindings

The generated bindings can be found in the bindings folder.

SDK Usage

For usage documentation + examples, see here.

Helpful Tips

  • After importing walletsdk.aar into your Android project, to use the Wallet SDK packages in a Kotlin or Java file, you import them in a roughly similar way as you would the equivalent Go package:
    // Follow the pattern below for other packages/types as well
    import dev.trustbloc.wallet.sdk.api.*;
    import dev.trustbloc.wallet.sdk.openid4ci.*;
    
  • After importing the iOS bindings into Xcode, to use the Wallet SDK in a Swift file, add the following:
    // This imports everything
    import Walletsdk
    
    To use the Wallet SDK in an Objective-C file, do the following:
    #import <Walletsdk/Walletsdk.h>
    
    Alternatively, you can import individual files. For example:
    #import <Walletsdk/Api.objc.h>
    #import <Walletsdk/Storage.objc.h>
    
    Note that the various types, interfaces and methods will have the package names prefixed to them (e.g. Signer in Go becomes CredentialsignerSigner in Swift and Objective-C).
  • If you've regenerated bindings on your machine, make sure you update your Android Studio or Xcode project accordingly.

Directories

Path Synopsis
activitylogger
Package api defines gomobile-compatible wallet-sdk interfaces.
Package api defines gomobile-compatible wallet-sdk interfaces.
Package attestation provides APIs for wallets to receive attestation credential.
Package attestation provides APIs for wallets to receive attestation credential.
Package credential contains an in-memory credential storage implementation.
Package credential contains an in-memory credential storage implementation.
Package did contains functionality related to DIDs.
Package did contains functionality related to DIDs.
Package didion contains a function that can be used to create did:ion documents.
Package didion contains a function that can be used to create did:ion documents.
Package didjwk contains a function that can be used to create did:jwk documents.
Package didjwk contains a function that can be used to create did:jwk documents.
Package didkey contains a function that can be used to create did:key documents.
Package didkey contains a function that can be used to create did:key documents.
Package display contains functionality that can be used to resolve display values per the OpenID4CI spec.
Package display contains functionality that can be used to resolve display values per the OpenID4CI spec.
Package localkms contains a KMS implementation that uses Google's Tink crypto library.
Package localkms contains a KMS implementation that uses Google's Tink crypto library.
metricslogger
Package oauth2 provides a client API for doing OAuth2 dynamic client registration per RFC7591: https://datatracker.ietf.org/doc/html/rfc7591
Package oauth2 provides a client API for doing OAuth2 dynamic client registration per RFC7591: https://datatracker.ietf.org/doc/html/rfc7591
Package openid4ci provides APIs for wallets to receive verifiable credentials via OIDC for Credential Issuance.
Package openid4ci provides APIs for wallets to receive verifiable credentials via OIDC for Credential Issuance.
Package openid4vp contains functionality for doing OpenID4VP operations.
Package openid4vp contains functionality for doing OpenID4VP operations.
Package otel contains functionality for open telemetry.
Package otel contains functionality for open telemetry.
Package trustregistry implements trust registry API.
Package trustregistry implements trust registry API.
Package verifiable contains functionality related to Verifiable Credentials.
Package verifiable contains functionality related to Verifiable Credentials.
Package version provide api for versioning information.
Package version provide api for versioning information.
Package walleterror defines the error model for the Go mobile API.
Package walleterror defines the error model for the Go mobile API.
Package wrapper contains wrappers that convert between the Go and gomobile APIs.
Package wrapper contains wrappers that convert between the Go and gomobile APIs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL