 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- func CheckRole(bitmask int, role Role) bool
- func GetCurveAndTranslator(curveID math.CurveID) (*math.Curve, idemix2.Translator, error)
- func GetFabricCAIdemixMspConfig(dir string, ID string) (*m.MSPConfig, error)
- func GetIdemixMspConfigWithType(dir string, ID string) (*m.MSPConfig, error)
- func GetIdemixRoleFromMSPRole(role *m.MSPRole) int
- func GetIdemixRoleFromMSPRoleType(rtype m.MSPRole_MSPRoleType) int
- func GetIdemixRoleFromMSPRoleValue(role int) int
- func GetLocalMspConfigWithType(dir string, id string) (*m.MSPConfig, error)
- func GetRoleMaskFromIdemixRole(role Role) int
- func GetRoleMaskFromIdemixRoles(roles []Role) int
- func NewBCCSP(curveID math.CurveID) (bccsp.BCCSP, error)
- func NewKSVBCCSP(kvsStore keystore.KVS, curveID math.CurveID, aries bool) (bccsp.BCCSP, error)
- func ReadFile(file string) ([]byte, error)
- type AuditInfo
- type Deserializer
- func (i *Deserializer) DeserializeAuditInfo(raw []byte) (*AuditInfo, error)
- func (i *Deserializer) DeserializeSigner(raw []byte) (driver.Signer, error)
- func (i *Deserializer) DeserializeVerifier(raw []byte) (driver.Verifier, error)
- func (i *Deserializer) DeserializeVerifierAgainstNymEID(raw []byte, nymEID []byte) (driver.Verifier, error)
- func (i *Deserializer) Info(raw []byte, auditInfo []byte) (string, error)
- func (i *Deserializer) String() string
 
- type FolderIdentityLoader
- type Idemix
- type Identity
- type IdentityCache
- type IdentityCacheBackendFunc
- type IdentityLoader
- type KVS
- type MSPIdentity
- func (id *MSPIdentity) Anonymous() bool
- func (id *MSPIdentity) ExpiresAt() time.Time
- func (id *MSPIdentity) GetIdentifier() *msp.IdentityIdentifier
- func (id *MSPIdentity) GetMSPIdentifier() string
- func (id *MSPIdentity) GetOrganizationalUnits() []*msp.OUIdentifier
- func (id *MSPIdentity) SatisfiesPrincipal(principal *m.MSPPrincipal) error
- func (id *MSPIdentity) Serialize() ([]byte, error)
- func (id *MSPIdentity) Validate() error
- func (id *MSPIdentity) Verify(msg []byte, sig []byte) error
 
- type MSPSigningIdentity
- type NymSignatureVerifier
- type Provider
- func NewProvider(conf1 *m.MSPConfig, signerService mspdriver.SignerService, ...) (*Provider, error)
- func NewProviderWithAnyPolicy(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService) (*Provider, error)
- func NewProviderWithAnyPolicyAndCurve(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService, curveID math.CurveID) (*Provider, error)
- func NewProviderWithEidRhNymPolicy(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService) (*Provider, error)
- func NewProviderWithSigType(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService, ...) (*Provider, error)
- func NewProviderWithSigTypeAncCurve(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService, ...) (*Provider, error)
- func NewProviderWithStandardPolicy(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService) (*Provider, error)
 
- func (p *Provider) DeserializeSigner(raw []byte) (driver.Signer, error)
- func (p *Provider) DeserializeSigningIdentity(raw []byte) (driver.SigningIdentity, error)
- func (p *Provider) DeserializeVerifier(raw []byte) (driver.Verifier, error)
- func (p *Provider) EnrollmentID() string
- func (p *Provider) Identity(opts *driver.IdentityOptions) (view.Identity, []byte, error)
- func (p *Provider) Info(raw []byte, auditInfo []byte) (string, error)
- func (p *Provider) IsRemote() bool
- func (p *Provider) String() string
 
- type Role
- type SignerConfig
Constants ¶
const ( ConfigDirUser = "user" ConfigFileIssuerPublicKey = "IssuerPublicKey" IdemixConfigFileRevocationPublicKey = "IssuerRevocationPublicKey" ConfigFileSigner = "SignerConfig" )
const ( EIDIndex = 2 RHIndex = 3 )
const (
	Any bccsp.SignatureType = 100
)
    const (
	MSPType = "idemix"
)
    Variables ¶
This section is empty.
Functions ¶
func CheckRole ¶ added in v0.3.0
CheckRole Prove that the desired role is contained or not in the bitmask
func GetCurveAndTranslator ¶ added in v0.3.0
func GetFabricCAIdemixMspConfig ¶ added in v0.3.0
GetFabricCAIdemixMspConfig returns the configuration for the Idemix MSP generated by Fabric-CA
func GetIdemixMspConfigWithType ¶ added in v0.4.0
GetIdemixMspConfigWithType returns the configuration for the Idemix MSP of the specified type
func GetIdemixRoleFromMSPRole ¶ added in v0.3.0
GetIdemixRoleFromMSPRole gets a MSP Role type and returns the integer value
func GetIdemixRoleFromMSPRoleType ¶ added in v0.3.0
func GetIdemixRoleFromMSPRoleType(rtype m.MSPRole_MSPRoleType) int
GetIdemixRoleFromMSPRoleType gets a MSP role type and returns the integer value
func GetIdemixRoleFromMSPRoleValue ¶ added in v0.3.0
GetIdemixRoleFromMSPRoleValue Receives a MSP role value and returns the idemix equivalent
func GetLocalMspConfigWithType ¶ added in v0.3.0
func GetRoleMaskFromIdemixRole ¶
GetRoleMaskFromIdemixRole return a bitmask for one role
func GetRoleMaskFromIdemixRoles ¶ added in v0.3.0
GetRoleMaskFromIdemixRoles Receive a list of roles to combine in a single bitmask
func NewBCCSP ¶ added in v0.3.0
NewBCCSP returns an instance of the idemix BCCSP for the given curve
func NewKSVBCCSP ¶ added in v0.3.0
NewKSVBCCSP returns an instance of the idemix BCCSP for the given curve and kvsStore
Types ¶
type AuditInfo ¶
type AuditInfo struct {
	EidNymAuditData *csp.AttrNymAuditData
	RhNymAuditData  *csp.AttrNymAuditData
	Attributes      [][]byte
	Csp             csp.BCCSP `json:"-"`
	IssuerPublicKey csp.Key   `json:"-"`
}
    func DeserializeAuditInfo ¶
func (*AuditInfo) EnrollmentID ¶
func (*AuditInfo) RevocationHandle ¶ added in v0.3.0
type Deserializer ¶ added in v0.3.0
type Deserializer struct {
	*Idemix
}
    func NewDeserializer ¶
func NewDeserializer(ipk []byte) (*Deserializer, error)
NewDeserializer returns a new deserializer for the best effort strategy
func NewDeserializerWithBCCSP ¶ added in v0.3.0
func NewDeserializerWithBCCSP(ipk []byte, verType csp.VerificationType, nymEID []byte, cryptoProvider csp.BCCSP) (*Deserializer, error)
func (*Deserializer) DeserializeAuditInfo ¶ added in v0.3.0
func (i *Deserializer) DeserializeAuditInfo(raw []byte) (*AuditInfo, error)
func (*Deserializer) DeserializeSigner ¶ added in v0.3.0
func (i *Deserializer) DeserializeSigner(raw []byte) (driver.Signer, error)
func (*Deserializer) DeserializeVerifier ¶ added in v0.3.0
func (i *Deserializer) DeserializeVerifier(raw []byte) (driver.Verifier, error)
func (*Deserializer) DeserializeVerifierAgainstNymEID ¶ added in v0.3.0
func (*Deserializer) Info ¶ added in v0.3.0
func (i *Deserializer) Info(raw []byte, auditInfo []byte) (string, error)
func (*Deserializer) String ¶ added in v0.3.0
func (i *Deserializer) String() string
type FolderIdentityLoader ¶ added in v0.2.0
type FolderIdentityLoader struct {
	*IdentityLoader
}
    type Idemix ¶ added in v0.3.0
type Idemix struct {
	Name            string
	Ipk             []byte
	Csp             bccsp.BCCSP
	IssuerPublicKey bccsp.Key
	RevocationPK    bccsp.Key
	Epoch           int
	VerType         bccsp.VerificationType
	NymEID          []byte
	RhNym           []byte
}
    func (*Idemix) Deserialize ¶ added in v0.3.0
func (*Idemix) DeserializeAgainstNymEID ¶ added in v0.3.0
type Identity ¶ added in v0.3.0
type Identity struct {
	Identity           *MSPIdentity
	NymPublicKey       bccsp.Key
	SerializedIdentity *m.SerializedIdentity
	OU                 *m.OrganizationUnit
	Role               *m.MSPRole
}
    type IdentityCache ¶ added in v0.2.0
type IdentityCache struct {
	// contains filtered or unexported fields
}
    func NewIdentityCache ¶ added in v0.2.0
func NewIdentityCache(backed IdentityCacheBackendFunc, size int, opts *driver.IdentityOptions) *IdentityCache
func (*IdentityCache) Identity ¶ added in v0.2.0
func (c *IdentityCache) Identity(opts *driver.IdentityOptions) (view.Identity, []byte, error)
type IdentityCacheBackendFunc ¶ added in v0.2.0
type IdentityLoader ¶ added in v0.2.0
type IdentityLoader struct {
	KVS           KVS
	SignerService driver.SignerService
}
    type MSPIdentity ¶ added in v0.3.0
type MSPIdentity struct {
	NymPublicKey bccsp.Key
	Idemix       *Idemix
	ID           *msp.IdentityIdentifier
	Role         *m.MSPRole
	OU           *m.OrganizationUnit
	// AssociationProof contains cryptographic proof that this identity
	// belongs to the MSP id.provider, i.e., it proves that the pseudonym
	// is constructed from a secret key on which the CA issued a credential.
	AssociationProof []byte
	VerificationType bccsp.VerificationType
}
    func NewMSPIdentityWithVerType ¶ added in v0.3.0
func NewMSPIdentityWithVerType(idemix *Idemix, NymPublicKey bccsp.Key, role *m.MSPRole, ou *m.OrganizationUnit, proof []byte, verificationType bccsp.VerificationType) (*MSPIdentity, error)
func (*MSPIdentity) Anonymous ¶ added in v0.3.0
func (id *MSPIdentity) Anonymous() bool
func (*MSPIdentity) ExpiresAt ¶ added in v0.3.0
func (id *MSPIdentity) ExpiresAt() time.Time
func (*MSPIdentity) GetIdentifier ¶ added in v0.3.0
func (id *MSPIdentity) GetIdentifier() *msp.IdentityIdentifier
func (*MSPIdentity) GetMSPIdentifier ¶ added in v0.3.0
func (id *MSPIdentity) GetMSPIdentifier() string
func (*MSPIdentity) GetOrganizationalUnits ¶ added in v0.3.0
func (id *MSPIdentity) GetOrganizationalUnits() []*msp.OUIdentifier
func (*MSPIdentity) SatisfiesPrincipal ¶ added in v0.3.0
func (id *MSPIdentity) SatisfiesPrincipal(principal *m.MSPPrincipal) error
func (*MSPIdentity) Serialize ¶ added in v0.3.0
func (id *MSPIdentity) Serialize() ([]byte, error)
func (*MSPIdentity) Validate ¶ added in v0.3.0
func (id *MSPIdentity) Validate() error
type MSPSigningIdentity ¶ added in v0.3.0
type MSPSigningIdentity struct {
	*MSPIdentity `json:"-"`
	Cred         []byte
	UserKey      bccsp.Key `json:"-"`
	NymKey       bccsp.Key `json:"-"`
	EnrollmentId string
}
    func (*MSPSigningIdentity) GetPublicVersion ¶ added in v0.3.0
func (id *MSPSigningIdentity) GetPublicVersion() driver.VerifyingIdentity
type NymSignatureVerifier ¶ added in v0.3.0
func (*NymSignatureVerifier) Verify ¶ added in v0.3.0
func (v *NymSignatureVerifier) Verify(message, sigma []byte) error
type Provider ¶ added in v0.3.0
type Provider struct {
	*Idemix
	SignerService mspdriver.SignerService
	// contains filtered or unexported fields
}
    func NewProvider ¶
func NewProvider(conf1 *m.MSPConfig, signerService mspdriver.SignerService, sigType bccsp.SignatureType, cryptoProvider bccsp.BCCSP) (*Provider, error)
func NewProviderWithAnyPolicy ¶ added in v0.3.0
func NewProviderWithAnyPolicyAndCurve ¶ added in v0.3.0
func NewProviderWithEidRhNymPolicy ¶ added in v0.3.0
func NewProviderWithSigType ¶
func NewProviderWithSigType(conf1 *m.MSPConfig, KVS KVS, sp mspdriver.SignerService, sigType bccsp.SignatureType) (*Provider, error)
func NewProviderWithSigTypeAncCurve ¶ added in v0.3.0
func NewProviderWithStandardPolicy ¶ added in v0.3.0
func (*Provider) DeserializeSigner ¶ added in v0.3.0
func (*Provider) DeserializeSigningIdentity ¶ added in v0.3.0
func (p *Provider) DeserializeSigningIdentity(raw []byte) (driver.SigningIdentity, error)
func (*Provider) DeserializeVerifier ¶ added in v0.3.0
func (*Provider) EnrollmentID ¶ added in v0.3.0
type SignerConfig ¶ added in v0.3.0
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 */
	// RevocationHandle is the handle used to single out this credential and determine its revocation status
	RevocationHandle string `protobuf:"bytes,7,opt,name=revocation_handle,json=revocationHandle,proto3" json:"revocation_handle,omitempty"`
	// CurveID specifies the name of the Idemix curve to use, defaults to 'amcl.Fp256bn'
	CurveID string `protobuf:"bytes,8,opt,name=curve_id,json=curveID" json:"curveID,omitempty"`
}
    SignerConfig contains the crypto material to set up an idemix signing identity