common

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: EUPL-1.2 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttributeTypes = map[int][]string{
	2: {
		"isSpecimen",
		"isPaperProof",
		"validFrom",
		"validForHours",
		"firstNameInitial",
		"lastNameInitial",
		"birthDay",
		"birthMonth",
	},
	3: {
		"isSpecimen",
		"isPaperProof",
		"validFrom",
		"validForHours",
		"firstNameInitial",
		"lastNameInitial",
		"birthDay",
		"birthMonth",
		"category",
	},
}
View Source
var BigOne = big.NewInt(1)
View Source
var GabiSystemParameters = gabi.DefaultSystemParameters[2048]
View Source
var ProofVersionByteV2 byte = '2'
View Source
var ProofVersionByteV3 byte = '3'

Functions

func CalculateProofIdentifier added in v0.6.0

func CalculateProofIdentifier(proof *gabi.ProofD) []byte

CalculateProofIdentifier calculates the sha256 digest of ProofD.C, truncated to 128 bits

func CalculateTimeBasedChallenge

func CalculateTimeBasedChallenge(unixTimeSeconds int64) *big.Int

func ComputeAttributeInts

func ComputeAttributeInts(attributeTypes []string, 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 ExtractProofVersion added in v0.8.2

func ExtractProofVersion(proofPrefixed []byte) (proofVersionByte byte, proofBase45 []byte, err error)

func GenerateNonce

func GenerateNonce() *big.Int

func HasNLPrefix added in v0.8.2

func HasNLPrefix(bts []byte) bool

func MaxCores added in v0.5.0

func MaxCores() int

MaxCores returns the number of cores in the current system

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 IssueSpecificationMessage added in v0.7.2

type IssueSpecificationMessage 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
}

type ProofSerializationV3 added in v0.8.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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