idemix

package
v1.5.22 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 18 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// CredType is the string that represents Idemix credential type
	CredType = "Idemix"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetIssuerPubKey() (*scheme.IssuerPublicKey, error)
	GetCSP() bccsp.BCCSP
}

Client represents a client that will load/store an Idemix credential

type Credential

type Credential struct {
	// contains filtered or unexported fields
}

Credential represents an Idemix credential. Implements Credential interface

func NewCredential

func NewCredential(signerConfigFile string, c Client, id idemix4.CurveID) *Credential

NewCredential is constructor for idemix.Credential

func (*Credential) CreateToken

func (cred *Credential) CreateToken(req *http.Request, reqBody []byte) (string, error)

CreateToken creates authorization token based on this Idemix credential

func (*Credential) EnrollmentID

func (cred *Credential) EnrollmentID() (string, error)

EnrollmentID returns enrollment ID associated with this Idemix credential

func (*Credential) Load

func (cred *Credential) Load() error

Load loads the Idemix credential from the location specified by the signerConfigFile attribute

func (*Credential) RevocationHandle added in v1.5.7

func (cred *Credential) RevocationHandle() (string, error)

RevocationHandle returns revocation handle associated with this Idemix credential

func (*Credential) RevokeSelf

func (cred *Credential) RevokeSelf() (*api.RevocationResponse, error)

RevokeSelf revokes this Idemix credential

func (*Credential) SetVal

func (cred *Credential) SetVal(val interface{}) error

SetVal sets *SignerConfig for this Idemix credential

func (*Credential) Store

func (cred *Credential) Store() error

Store stores this Idemix credential to the location specified by the signerConfigFile attribute

func (*Credential) Type

func (cred *Credential) Type() string

Type returns Idemix

func (*Credential) Val

func (cred *Credential) Val() (interface{}, error)

Val returns *SignerConfig associated with this Idemix credential

type SignerConfig

type SignerConfig struct {
	// Cred represents the serialized idemix credential of the default signer
	Cred []byte `protobuf:"bytes,1,opt,name=Cred,proto3" json:"Cred,omitempty"`
	// Sk is the secret key of the default signer, corresponding to credential Cred
	Sk []byte `protobuf:"bytes,2,opt,name=Sk,proto3" json:"Sk,omitempty"`
	// OrganizationalUnitIdentifier defines the organizational unit the default signer is in
	OrganizationalUnitIdentifier string `` /* 140-byte string literal not displayed */
	// Role defines whether the default signer is admin, member, peer, or client
	Role int `protobuf:"varint,4,opt,name=role,json=role" json:"role,omitempty"`
	// EnrollmentID contains the enrollment id of this signer
	EnrollmentID string `protobuf:"bytes,5,opt,name=enrollment_id,json=enrollmentId" json:"enrollment_id,omitempty"`
	// CRI contains a serialized Credential Revocation Information
	CredentialRevocationInformation []byte `` /* 156-byte string literal not displayed */
	// CurveID specifies the name of the Idemix curve to use, defaults to 'amcl.Fp256bn'
	CurveID string `protobuf:"bytes,7,opt,name=curve_id,json=curveID" json:"curveID,omitempty"`
	// RevocationHandle is the handle used to single out this credential and determine its revocation status
	RevocationHandle string `protobuf:"bytes,8,opt,name=revocation_handle,json=revocationHandle,proto3" json:"revocation_handle,omitempty"`
}

SignerConfig contains the crypto material to set up an idemix signing identity

func (*SignerConfig) GetCred

func (s *SignerConfig) GetCred() []byte

GetCred returns credential associated with this signer config

func (*SignerConfig) GetCredentialRevocationInformation

func (s *SignerConfig) GetCredentialRevocationInformation() []byte

GetCredentialRevocationInformation returns CRI

func (*SignerConfig) GetEnrollmentID

func (s *SignerConfig) GetEnrollmentID() string

GetEnrollmentID returns enrollment ID of the user associated with this signer config

func (*SignerConfig) GetOrganizationalUnitIdentifier

func (s *SignerConfig) GetOrganizationalUnitIdentifier() string

GetOrganizationalUnitIdentifier returns OU of the user associated with this signer config

func (*SignerConfig) GetRole added in v1.3.0

func (s *SignerConfig) GetRole() int

GetRole returns true if the user associated with this signer config is an admin, else returns role

func (*SignerConfig) GetSk

func (s *SignerConfig) GetSk() []byte

GetSk returns secret key associated with this signer config

Jump to

Keyboard shortcuts

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