cl

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlindedCredentialSecrets

type BlindedCredentialSecrets struct {
	Handle           []byte
	BlindingFactor   []byte
	CorrectnessProof []byte
}

BlindedCredentialSecrets contains handle, blinding factor and correctness proof of CL BlindedSecrets.

type Credential

type Credential struct {
	Signature []byte
	Values    map[string]interface{}
	SigProof  []byte
}

Credential contains CL Credential's signature, correctness proof for it and related credential's values.

type CredentialDefinition

type CredentialDefinition struct {
	CredPubKey              []byte
	CredDefCorrectnessProof []byte
	Attrs                   []string
}

CredentialDefinition contains public data of CL CredDef.

type CredentialOffer

type CredentialOffer struct {
	Nonce []byte
}

CredentialOffer contains nonce of CL CredOffer.

type CredentialRequest

type CredentialRequest struct {
	BlindedCredentialSecrets *BlindedCredentialSecrets
	Nonce                    []byte
	ProverID                 string
}

CredentialRequest contains nonce, proverID and blinded secrets of CL CredRequest.

type Issuer

type Issuer interface {
	// GetCredentialDefinition returns a public CredDef data - public key, correctness proof and attributes
	// returns:
	// 		credDef as *CredentialDefinition
	//		error in case of errors
	GetCredentialDefinition() (*CredentialDefinition, error)
	// OfferCredential generates CredOffer containing valid nonce
	// returns:
	// 		offer as *CredentialOffer
	//		error in case of errors
	OfferCredential() (*CredentialOffer, error)
	// IssueCredential issues and signs Credential for values and CredRequest
	// provided by prover and CredOffer from the previous step
	// Resulting Credential will contain signature and signature's correctness proof, along with issued attributes
	// returns:
	// 		credential as *Credential
	//		error in case of errors
	IssueCredential(values map[string]interface{},
		credentialRequest *CredentialRequest, credOffer *CredentialOffer) (*Credential, error)
}

Issuer contains all high-level methods to process CL Anoncreds on the issuer's side.

type Predicate

type Predicate struct {
	Attr  string
	PType string
	Value int32
}

Predicate defines predicate for CL Proof.

type PresentationRequest

type PresentationRequest struct {
	Items []*PresentationRequestItem
	Nonce []byte
}

PresentationRequest contains items used for CL Proof generation.

type PresentationRequestItem

type PresentationRequestItem struct {
	RevealedAttrs []string
	Predicates    []*Predicate
}

PresentationRequestItem consists of revealed attributes and predicates upon which CL Proof is generated.

type Proof

type Proof struct {
	Proof []byte
}

Proof wraps CL Proof in raw bytes.

type Prover

type Prover interface {
	// RequestCredential generates CredRequest which contains blinded secrets with MS, using issuer's CredDef public data
	// and CredOffer from the previous step
	// returns:
	// 		request as *CredentialRequest
	//		error in case of errors
	RequestCredential(credOffer *CredentialOffer,
		credDef *CredentialDefinition, proverID string) (*CredentialRequest, error)
	// ProcessCredential updates issued Credential signature for CredDef, using blinding factor from a CredRequest
	// returns:
	// 		credential as *Credential
	//		error in case of errors
	ProcessCredential(credential *Credential, credRequest *CredentialRequest,
		credDef *CredentialDefinition) (*Credential, error)
	// CreateProof composes Proof for the provided Credentials for CredDefs
	// matching revealead attrs and predicates specified in PresentationRequest
	// returns:
	// 		proof as *Proof
	//		error in case of errors
	CreateProof(presentationRequest *PresentationRequest, credentials []*Credential,
		credDefs []*CredentialDefinition) (*Proof, error)
}

Prover contains all high-level methods to process CL Anoncreds on the prover's side.

type Provider

type Provider interface {
	KMS() kms.KeyManager
	Crypto() crypto.Crypto
}

Provider for CL services constructors.

type Verifier

type Verifier interface {
	// RequestPresentation generates PresentationRequest with unique nonce and provided list of attrs and predicates
	// returns:
	// 		request as *PresentationRequest
	//		error in case of errors
	RequestPresentation(items []*PresentationRequestItem) (*PresentationRequest, error)
	// VerifyProof verifies given Proof according to PresentationRequest and CredDefs
	// returns:
	//		error in case of errors or nil if proof verification was successful
	VerifyProof(proof *Proof, presentationRequest *PresentationRequest, credDefs []*CredentialDefinition) error
}

Verifier contains all high-level methods to process CL Anoncreds on the verifier's side.

Jump to

Keyboard shortcuts

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