Versions in this module Expand all Collapse all v1 v1.4.8 Jul 31, 2020 Changes in this version + const AttrEnrollmentID + const AttrOU + const AttrRevocationHandle + const AttrRole + const DefaultIssuerPublicKeyFile + const DefaultIssuerSecretKeyFile + const DefaultNonceExpiration + const DefaultNonceSweepInterval + const DefaultRevocationHandlePoolSize + const DefaultRevocationPrivateKeyFile + const DefaultRevocationPublicKeyFile + const DeleteCredentialbyID + const InsertCredentialSQL + const InsertNonce + const InsertRAInfo + const KeystoreDir + const RemoveExpiredNonces + const RemoveNonce + const SelectCredentialByIDSQL + const SelectCredentialSQL + const SelectNonce + const SelectRAInfo + const SelectRevokedCredentialSQL + const UpdateNextAndLastHandle + const UpdateNextHandle + const UpdateRevokeCredentialSQL + func CheckRole(bitmask int, role Role) bool + func DecodeKeys(pemEncodedPK, pemEncodedPubKey []byte) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error) + func EncodeKeys(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) ([]byte, []byte, error) + func GetAttributeNames() []string + func GetRoleMask(roles []Role) int + func IsToken(token string) bool + type CRIRequestHandler struct + Ctx ServerRequestCtx + Issuer MyIssuer + func (ch *CRIRequestHandler) HandleRequest() (*api.GetCRIResponse, error) + type Clock interface + Now func() time.Time + type Config struct + IssuerPublicKeyfile string + IssuerSecretKeyfile string + NonceExpiration string + NonceSweepInterval string + RHPoolSize int + RevocationPrivateKeyfile string + RevocationPublicKeyfile string + type CredDBAccessor interface + GetCredential func(revocationHandle string) (*CredRecord, error) + GetCredentialsByID func(id string) ([]CredRecord, error) + GetRevokedCredentials func() ([]CredRecord, error) + InsertCredential func(cr CredRecord) error + SetDB func(db db.FabricCADB) + func NewCredentialAccessor(db db.FabricCADB, level int) CredDBAccessor + type CredRecord struct + CALabel string + Cred string + Expiry time.Time + ID string + Level int + Reason int + RevocationHandle string + RevokedAt time.Time + Status string + type CredentialAccessor struct + func (ac *CredentialAccessor) GetCredential(revocationHandle string) (*CredRecord, error) + func (ac *CredentialAccessor) GetCredentialsByID(id string) ([]CredRecord, error) + func (ac *CredentialAccessor) GetRevokedCredentials() ([]CredRecord, error) + func (ac *CredentialAccessor) InsertCredential(cr CredRecord) error + func (ac *CredentialAccessor) SetDB(db db.FabricCADB) + type EnrollRequestHandler struct + Ctx ServerRequestCtx + EnrollmentID string + IdmxLib Lib + Issuer MyIssuer + func (h *EnrollRequestHandler) Authenticate() error + func (h *EnrollRequestHandler) GenerateNonce() (*fp256bn.BIG, error) + func (h *EnrollRequestHandler) GetAttributeValues(caller user.User, ipk *idemix.IssuerPublicKey, rh *fp256bn.BIG) (map[string]interface{}, []*fp256bn.BIG, error) + func (h *EnrollRequestHandler) HandleRequest() (*EnrollmentResponse, error) + type EnrollmentResponse struct + Attrs map[string]interface{} + CRI string + Credential string + Nonce string + type Issuer interface + GetCRI func(ctx ServerRequestCtx) (*api.GetCRIResponse, error) + Init func(renew bool, db db.FabricCADB, levels *dbutil.Levels) error + IssueCredential func(ctx ServerRequestCtx) (*EnrollmentResponse, error) + IssuerPublicKey func() ([]byte, error) + RevocationPublicKey func() ([]byte, error) + VerifyToken func(authHdr, method, uri string, body []byte) (string, error) + func NewIssuer(name, homeDir string, config *Config, csp bccsp.BCCSP, idemixLib Lib) Issuer + type IssuerCredential interface + GetIssuerKey func() (*idemix.IssuerKey, error) + Load func() error + NewIssuerKey func() (*idemix.IssuerKey, error) + SetIssuerKey func(key *idemix.IssuerKey) + Store func() error + func NewIssuerCredential(pubKeyFile, secretKeyFile string, lib Lib) IssuerCredential + type Lib interface + CreateCRI func(key *ecdsa.PrivateKey, unrevokedHandles []*fp256bn.BIG, epoch int, ...) (cri *idemix.CredentialRevocationInformation, err error) + GenerateLongTermRevocationKey func() (pk *ecdsa.PrivateKey, err error) + GetRand func() (rand *amcl.RAND, err error) + NewCredential func(key *idemix.IssuerKey, m *idemix.CredRequest, attrs []*fp256bn.BIG, ...) (cred *idemix.Credential, err error) + NewIssuerKey func(AttributeNames []string, rng *amcl.RAND) (ik *idemix.IssuerKey, err error) + RandModOrder func(rng *amcl.RAND) (big *fp256bn.BIG, err error) + func NewLib() Lib + type MyIssuer interface + Config func() *Config + CredDBAccessor func() CredDBAccessor + DB func() db.FabricCADB + HomeDir func() string + IdemixLib func() Lib + IdemixRand func() *amcl.RAND + IssuerCredential func() IssuerCredential + Name func() string + NonceManager func() NonceManager + RevocationAuthority func() RevocationAuthority + type Nonce struct + Expiry time.Time + Level int + Val string + type NonceManager interface + CheckNonce func(nonce *fp256bn.BIG) error + GetNonce func() (*fp256bn.BIG, error) + SweepExpiredNonces func() error + func NewNonceManager(issuer MyIssuer, clock Clock, level int) (NonceManager, error) + type RevocationAuthority interface + CreateCRI func() (*idemix.CredentialRevocationInformation, error) + Epoch func() (int, error) + GetNewRevocationHandle func() (*fp256bn.BIG, error) + PublicKey func() *ecdsa.PublicKey + func NewRevocationAuthority(issuer MyIssuer, level int) (RevocationAuthority, error) + type RevocationAuthorityInfo struct + Epoch int + LastHandleInPool int + Level int + NextRevocationHandle int + type RevocationKey interface + GetKey func() *ecdsa.PrivateKey + Load func() error + SetKey func(key *ecdsa.PrivateKey) + SetNewKey func() error + Store func() error + func NewRevocationKey(pubKeyFile, privateKeyFile string, lib Lib) RevocationKey + type Role int32 + const ADMIN + const CLIENT + const MEMBER + const PEER + type ServerRequestCtx interface + BasicAuthentication func() (string, error) + GetCaller func() (user.User, error) + IsBasicAuth func() bool + ReadBody func(body interface{}) error + TokenAuthentication func() (string, error)