mobile

package module
v0.0.0-...-f93f300 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

Mobile

Mobile makes use of Go Mobile. Bindings are maintained in this package. Mage targets are exposed to generate bindings for iOS and Android. At present, files must not be nested in subdirectories for bindings to be generated correctly.

iOS

mage ios

Android

mage android

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDIDKey

func CreateDIDKey(requestBytes []byte) ([]byte, error)

CreateDIDKey creates a new DID key from an existing public key, accepting a JSON representation of CreateDIDKeyRequest and returns a JSON representation of CreateDIDKeyResult which contains the DID of the newly created key as a string

func ExpandDIDKey

func ExpandDIDKey(didKey string) ([]byte, error)

ExpandDIDKey expands a DID key string and returns a JSON representation of the expanded key Returns a JSON representation of Document

func GenerateDIDKey

func GenerateDIDKey(kt string) ([]byte, error)

GenerateDIDKey generates a new DID key and returns a JSON representation of GenerateDIDKeyResult

func GetSupportedKeyTypes

func GetSupportedKeyTypes() []string

GetSupportedKeyTypes returns a list of supported key types as string values

Types

type CreateDIDKeyRequest

type CreateDIDKeyRequest struct {
	// KeyType is the type of key to be created, such as "Ed25519VerificationKey2018"
	KeyType string `json:"keyType"`
	// PublicKeyJWK is the JSON Web Key (public key) of the DID Key to be created
	PublicKeyJWK map[string]any `json:"publicKeyJwk"`
}

CreateDIDKeyRequest is a struct that contains the key type and public key JWK of a DID key to be created

type CreateDIDKeyResult

type CreateDIDKeyResult struct {
	// DID is the string of the DID Key created, such as did:key:z6Mk...
	DID string `json:"did"`
}

CreateDIDKeyResult is a struct that contains the DID of a newly created DID key

type Document

type Document struct {
	// DIDDocument is the JSON representation of the DID document of a DID key
	DIDDocument map[string]any `json:"didDocument"`
}

Document is a struct that contains the DID document of a DID key

type GenerateDIDKeyResult

type GenerateDIDKeyResult struct {
	// DID is the string of the DID Key created, such as did:key:z6Mk...
	DID string `json:"did"`
	// JWK is the JSON Web Key (private key) of the newly created DID Key
	JWK map[string]any `json:"jwk"`
}

GenerateDIDKeyResult is a struct that contains the DID and JWK of a newly generated DID key It is returned as a result of the GenerateDIDKey function

Jump to

Keyboard shortcuts

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