Documentation
¶
Index ¶
- Constants
- func BuildCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- func BuildCredential(this js.Value, inputs []js.Value) (interface{}, error)
- func BuildPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- func CreateAccumulator(this js.Value, inputs []js.Value) (interface{}, error)
- func GenKey(this js.Value, inputs []js.Value) (interface{}, error)
- func GenKeypair(this js.Value, inputs []js.Value) (interface{}, error)
- func GetAccumulatorIndex(this js.Value, inputs []js.Value) (interface{}, error)
- func GetAccumulatorTimestamp(this js.Value, inputs []js.Value) (interface{}, error)
- func IssueAttestation(this js.Value, inputs []js.Value) (interface{}, error)
- func KeyFromSeed(this js.Value, inputs []js.Value) (interface{}, error)
- func RequestAttestation(this js.Value, inputs []js.Value) (interface{}, error)
- func RequestCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- func RequestPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- func RevokeAttestation(this js.Value, inputs []js.Value) (interface{}, error)
- func StartAttestationSession(this js.Value, inputs []js.Value) (interface{}, error)
- func UpdateAllCredential(this js.Value, inputs []js.Value) (interface{}, error)
- func UpdateCredential(this js.Value, inputs []js.Value) (interface{}, error)
- func VerifyCombinedPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- func VerifyPresentation(this js.Value, inputs []js.Value) (interface{}, error)
- type GoFunction
- type JSFunction
Constants ¶
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 BuildCredential ¶
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 ¶
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 ¶
CreateAccumulator creates a new accumulator which can be used to revoke attestations
func GenKeypair ¶
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 ¶
GetAccumulatorIndex verifies the update and returns the current accumulator index.
func GetAccumulatorTimestamp ¶
GetAccumulatorTimestamp verifies the update and returns the current accumulator Timestamp.
func IssueAttestation ¶
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
KeyFromSeed derives a key from a given seed
func RequestAttestation ¶
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 RequestPresentation ¶
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 ¶
RevokeAttestation removes the attestation witness from the given accumulator.
func StartAttestationSession ¶
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 ¶
UpdateAllCredential updates the non revocation witness using all the provided updates.
func UpdateCredential ¶
UpdateCredential updates the non revocation witness using the provided update.
func VerifyCombinedPresentation ¶
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 ¶
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 ¶
GoFunction is a function which can be transform it into a JSFunction
type JSFunction ¶
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