const ( // CredType is the string that represents Idemix credential type CredType = "Idemix" )
Client represents a client that will load/store an Idemix credential
type Client interface { GetIssuerPubKey() (*idemix.IssuerPublicKey, error) GetCSP() bccsp.BCCSP }
Credential represents an Idemix credential. Implements Credential interface
type Credential struct {
// contains filtered or unexported fields
}
func NewCredential(signerConfigFile string, c Client) *Credential
NewCredential is constructor for idemix.Credential
func (cred *Credential) CreateToken(req *http.Request, reqBody []byte) (string, error)
CreateToken creates authorization token based on this Idemix credential
func (cred *Credential) EnrollmentID() (string, error)
EnrollmentID returns enrollment ID associated with this Idemix credential
func (cred *Credential) Load() error
Load loads the Idemix credential from the location specified by the signerConfigFile attribute
func (cred *Credential) RevokeSelf() (*api.RevocationResponse, error)
RevokeSelf revokes this Idemix credential
func (cred *Credential) SetVal(val interface{}) error
SetVal sets *SignerConfig for this Idemix credential
func (cred *Credential) Store() error
Store stores this Idemix credential to the location specified by the signerConfigFile attribute
func (cred *Credential) Type() string
Type returns Idemix
func (cred *Credential) Val() (interface{}, error)
Val returns *SignerConfig associated with this Idemix credential
SignerConfig contains the crypto material to set up an idemix signing identity
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 `protobuf:"bytes,3,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier" json:"organizational_unit_identifier,omitempty"` // 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 `protobuf:"bytes,6,opt,name=credential_revocation_information,json=credentialRevocationInformation,proto3" json:"credential_revocation_information,omitempty"` }
func (s *SignerConfig) GetCred() []byte
GetCred returns credential associated with this signer config
func (s *SignerConfig) GetCredentialRevocationInformation() []byte
GetCredentialRevocationInformation returns CRI
func (s *SignerConfig) GetEnrollmentID() string
GetEnrollmentID returns enrollment ID of the user associated with this signer config
func (s *SignerConfig) GetOrganizationalUnitIdentifier() string
GetOrganizationalUnitIdentifier returns OU of the user associated with this signer config
func (s *SignerConfig) GetRole() int
GetRole returns true if the user associated with this signer config is an admin, else returns role
func (s *SignerConfig) GetSk() []byte
GetSk returns secret key associated with this signer config