wasm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: BSD-4-Clause Imports: 9 Imported by: 1

Documentation

Rendered for js/wasm

Index

Constants

View Source
const (
	TimeFormat       = time.RFC3339Nano
	DefaultKeyLength = 1024
)

KeyLength sets the length of the used keys. Possible values are 1024, 2048, 4096

Variables

This section is empty.

Functions

func BuildCombinedPresentation

func BuildCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)

func BuildCredential

func BuildCredential(this js.Value, inputs []js.Value) (interface{}, error)

BuildCredential creates a credential which can be used to create proofs that the claimer posseses certain attributes. This method expects as input the private key of the claimer, the session object created by requestAttestation and the signature message send the attester.

func BuildPresentation

func BuildPresentation(this js.Value, inputs []js.Value) (interface{}, error)

BuildPresentation creates a proof that the claimer possesses the requested attributes. This method takes as input the private key of the claimer, the credential which contains the requested attributes, a json encoded list containing the requested attributes and the public key of the attester. It returns a proof containing the values of the requested attributes.

func CreateAccumulator

func CreateAccumulator(this js.Value, inputs []js.Value) (interface{}, error)

CreateAccumulator creates a new accumulator which can be used to revoke attestations

func GenKey

func GenKey(this js.Value, inputs []js.Value) (interface{}, error)

GenKey creates the private key for the claimer

func GenKeypair

func GenKeypair(this js.Value, inputs []js.Value) (interface{}, error)

GenKeypair generates a keypair for the attester. It takes no inputs and returns a list containing the private key as the fist element and the public key as the second element. If the key generation fails, an error is returned.

func GetAccumulatorIndex

func GetAccumulatorIndex(this js.Value, inputs []js.Value) (interface{}, error)

GetAccumulatorIndex verifies the update and returns the current accumulator index.

func GetAccumulatorTimestamp

func GetAccumulatorTimestamp(this js.Value, inputs []js.Value) (interface{}, error)

GetAccumulatorTimestamp verifies the update and returns the current accumulator Timestamp.

func IssueAttestation

func IssueAttestation(this js.Value, inputs []js.Value) (interface{}, error)

IssueAttestation takes the private key of the attester as first input and the public key as second input. As third input the session (created using the startAttestationSession method) is expected and the fourth input is the request for attestion which is was send to the attester by the claimer.

func KeyFromSeed added in v0.2.1

func KeyFromSeed(this js.Value, inputs []js.Value) (interface{}, error)

KeyFromSeed derives a key from a given seed

func RequestAttestation

func RequestAttestation(this js.Value, inputs []js.Value) (interface{}, error)

RequestAttestation creates a session object and a message which request the attestation of specific attributes. The second object should be sent to an attester. This method expects as inputs the private key of the claimer, a json encoded string containing the claim which should be attested, the handshake message from the attester and the public key of the attester.

func RequestCombinedPresentation

func RequestCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)

func RequestPresentation

func RequestPresentation(this js.Value, inputs []js.Value) (interface{}, error)

RequestPresentation creates a message which request the discloser of specific attributes. As input this method takes the names of the requested attributes. This message takes a variable number of inputs. If no error occurs a session object and a message for the claimer is returned.

func RevokeAttestation

func RevokeAttestation(this js.Value, inputs []js.Value) (interface{}, error)

RevokeAttestation removes the attestation witness from the given accumulator.

func StartAttestationSession

func StartAttestationSession(this js.Value, inputs []js.Value) (interface{}, error)

StartAttestationSession starts the attestation process. It takes the private key of the attester as first input and the public key as second input. This method returns a session object, which must be used as an argument for issueAttestation and a message for the claimer

func UpdateAllCredential

func UpdateAllCredential(this js.Value, inputs []js.Value) (interface{}, error)

UpdateAllCredential updates the non revocation witness using all the provided updates.

func UpdateCredential

func UpdateCredential(this js.Value, inputs []js.Value) (interface{}, error)

UpdateCredential updates the non revocation witness using the provided update.

func VerifyCombinedPresentation

func VerifyCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)

VerifyCombinedPresentation verifies that the proof of the claimer is valid. As input this method takes the proof, a session object (created using startVerificationSession) and the public key of the attester which attested the claim

func VerifyPresentation

func VerifyPresentation(this js.Value, inputs []js.Value) (interface{}, error)

VerifyPresentation verifies that the proof of the claimer is valid. As input this method takes the proof, a session object (created using startVerificationSession) and the public key of the attester which attested the claim

Types

type GoFunction

type GoFunction func(js.Value, []js.Value) (interface{}, error)

GoFunction is a function which can be transform it into a JSFunction

type JSFunction

type JSFunction func(js.Value, []js.Value) interface{}

JSFunction is a function which can be used from JS code.

func Callbacker

func Callbacker(function GoFunction) JSFunction

Callbacker takes a go function and wraps it, so that a callback is called. This makes is usable as a js interface function

Jump to

Keyboard shortcuts

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