common

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: EUPL-1.2 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttributeTypesV2 = []string{
	"isSpecimen",
	"isPaperProof",
	"validFrom",
	"validForHours",
	"firstNameInitial",
	"lastNameInitial",
	"birthDay",
	"birthMonth",
}
View Source
var AttributeTypesV3 = []string{
	"isSpecimen",
	"isPaperProof",
	"validFrom",
	"validForHours",
	"firstNameInitial",
	"lastNameInitial",
	"birthDay",
	"birthMonth",
	"category",
}
View Source
var BigOne = big.NewInt(1)
View Source
var CredentialVersion = 2
View Source
var CredentialVersionBytes = []byte{byte(CredentialVersion)}
View Source
var GabiSystemParameters = gabi.DefaultSystemParameters[2048]
View Source
var ProofVersionByte byte = '2'

Functions

func CalculateTimeBasedChallenge

func CalculateTimeBasedChallenge(unixTimeSeconds int64) *big.Int

func ComputeAttributeInts

func ComputeAttributeInts(attributes [][]byte) ([]*big.Int, error)

func DebugSerializableStruct

func DebugSerializableStruct(s interface{})

func DecodeAttributeInt

func DecodeAttributeInt(a *big.Int) []byte

func DecodeMetadataAttribute

func DecodeMetadataAttribute(metadataAttribute *big.Int) (credentialVersion int, issuerPkId string, attributeTypes []string, err error)

func GenerateNonce

func GenerateNonce() *big.Int

func RandomBigInt

func RandomBigInt(numBits uint) *big.Int

RandomBigInt returns a random big integer value in the range [0,(2^numBits)-1], inclusive.

Types

type CreateCredentialMessage

type CreateCredentialMessage struct {
	IssueSignatureMessage *gabi.IssueSignatureMessage `json:"issueSignatureMessage"`
	Attributes            [][]byte                    `json:"attributes"`
}

type CredentialMetadataSerialization

type CredentialMetadataSerialization struct {
	// CredentialVersion identifies the credential version, and is always a single byte
	CredentialVersion []byte

	// IssuerPkId identifies the public key to use for verification
	IssuerPkId string
}

type FindIssuerPkFunc added in v0.3.0

type FindIssuerPkFunc func(kid string) (pk *gabi.PublicKey, err error)

type PrepareIssueMessage

type PrepareIssueMessage struct {
	IssuerPkId       string   `json:"issuerPkId"`
	IssuerNonce      *big.Int `json:"issuerNonce"`
	CredentialAmount int      `json:"credentialAmount"`
}

type ProofSerializationV2 added in v0.3.0

type ProofSerializationV2 struct {
	DisclosureTimeSeconds int64
	C                     *gobig.Int
	A                     *gobig.Int
	EResponse             *gobig.Int
	VResponse             *gobig.Int
	AResponse             *gobig.Int
	ADisclosed            []*gobig.Int
}

Jump to

Keyboard shortcuts

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