Documentation
¶
Index ¶
- Constants
- func CheckRole(bitmask int, role RoleAttribute) bool
- func GetCurveAndTranslator(curveID math.CurveID) (*math.Curve, idemix3.Translator, error)
- func GetFabricCAIdemixMspConfig(issuerPublicKey []byte, dir string, ID string) (*msp.MSPConfig, error)
- func GetIdemixMspConfigWithType(issuerPublicKey []byte, dir string, ID string, ignoreVerifyOnlyWallet bool) (*msp.MSPConfig, error)
- func GetIdemixRoleFromMSPRole(role *m.MSPRole) int
- func GetIdemixRoleFromMSPRoleType(rtype m.MSPRole_MSPRoleType) int
- func GetIdemixRoleFromMSPRoleValue(role int) int
- func NewBCCSP(keyStore bccsp.KeyStore, curveID math.CurveID, aries bool) (bccsp.BCCSP, error)
- func NewBCCSPWithDummyKeyStore(curveID math.CurveID, aries bool) (bccsp.BCCSP, error)
- func NewKeyStore(curveID math.CurveID, backend keystore.KVS) (bccsp.KeyStore, error)
- func NewMSPConfig(issuerPublicKey []byte, signer *idemixmsp.IdemixMSPSignerConfig, ID string) (*msp.MSPConfig, error)
- func NewMSPConfigFromRawSigner(issuerPublicKey []byte, signerRaw []byte, ID string) (*msp.MSPConfig, error)
- func NewMSPConfigFromURL(issuerPublicKey []byte, dir string, id string, ignoreVerifyOnlyWallet bool) (*msp.MSPConfig, error)
- func ReadFile(file string) ([]byte, error)
- type AuditInfo
- type DeserializedIdentity
- type Deserializer
- type Identity
- func (id *Identity) Anonymous() bool
- func (id *Identity) ExpiresAt() time.Time
- func (id *Identity) GetIdentifier() *msp.IdentityIdentifier
- func (id *Identity) GetMSPIdentifier() string
- func (id *Identity) GetOrganizationalUnits() []*msp.OUIdentifier
- func (id *Identity) SatisfiesPrincipal(principal *m.MSPPrincipal) error
- func (id *Identity) Serialize() ([]byte, error)
- func (id *Identity) Validate() error
- func (id *Identity) Verify(msg []byte, sig []byte) error
- type NymSignatureVerifier
- type RoleAttribute
- type SignerConfig
- type SigningIdentity
Constants ¶
const ( ConfigDirUser = "user" ConfigFileSigner = "SignerConfig" )
const ( EIDIndex = 2 RHIndex = 3 SignerConfigFull = "SignerConfigFull" IdentityConfigurationType = "idemix" )
Variables ¶
This section is empty.
Functions ¶
func CheckRole ¶
func CheckRole(bitmask int, role RoleAttribute) bool
CheckRole Prove that the desired role is contained or not in the bitmask
func GetCurveAndTranslator ¶
func GetFabricCAIdemixMspConfig ¶
func GetFabricCAIdemixMspConfig(issuerPublicKey []byte, dir string, ID string) (*msp.MSPConfig, error)
GetFabricCAIdemixMspConfig returns the configuration for the Idemix MSP generated by Fabric-CA
func GetIdemixMspConfigWithType ¶
func GetIdemixMspConfigWithType(issuerPublicKey []byte, dir string, ID string, ignoreVerifyOnlyWallet bool) (*msp.MSPConfig, error)
GetIdemixMspConfigWithType returns the configuration for the Idemix MSP of the specified type
func GetIdemixRoleFromMSPRole ¶
GetIdemixRoleFromMSPRole gets a MSP RoleAttribute type and returns the integer value
func GetIdemixRoleFromMSPRoleType ¶
func GetIdemixRoleFromMSPRoleType(rtype m.MSPRole_MSPRoleType) int
GetIdemixRoleFromMSPRoleType gets a MSP role type and returns the integer value
func GetIdemixRoleFromMSPRoleValue ¶
GetIdemixRoleFromMSPRoleValue Receives a MSP role value and returns the idemix equivalent
func NewBCCSPWithDummyKeyStore ¶
NewBCCSPWithDummyKeyStore returns an instance of the idemix BCCSP for the given curve
func NewKeyStore ¶
func NewMSPConfig ¶
func NewMSPConfigFromURL ¶
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 ¶
type DeserializedIdentity ¶
type DeserializedIdentity struct {
Identity *Identity
NymPublicKey bccsp.Key
SerializedIdentity *m.SerializedIdentity
OU *m.OrganizationUnit
Role *m.MSPRole
}
type Deserializer ¶
type Deserializer struct {
Name string
Ipk []byte
Csp bccsp.BCCSP
IssuerPublicKey bccsp.Key
RevocationPK bccsp.Key
Epoch int
VerType bccsp.VerificationType
NymEID []byte
RhNym []byte
}
func (*Deserializer) Deserialize ¶
func (c *Deserializer) Deserialize(raw []byte, checkValidity bool) (*DeserializedIdentity, error)
func (*Deserializer) DeserializeAgainstNymEID ¶
func (c *Deserializer) DeserializeAgainstNymEID(raw []byte, checkValidity bool, nymEID []byte) (*DeserializedIdentity, error)
func (*Deserializer) DeserializeAuditInfo ¶
func (c *Deserializer) DeserializeAuditInfo(raw []byte) (*AuditInfo, error)
type Identity ¶
type Identity struct {
NymPublicKey bccsp.Key
Idemix *Deserializer
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 NewIdentity ¶
func NewIdentity(idemix *Deserializer, NymPublicKey bccsp.Key, role *m.MSPRole, ou *m.OrganizationUnit, proof []byte, verificationType bccsp.VerificationType) (*Identity, error)
func (*Identity) GetIdentifier ¶
func (id *Identity) GetIdentifier() *msp.IdentityIdentifier
func (*Identity) GetMSPIdentifier ¶
func (*Identity) GetOrganizationalUnits ¶
func (id *Identity) GetOrganizationalUnits() []*msp.OUIdentifier
func (*Identity) SatisfiesPrincipal ¶
func (id *Identity) SatisfiesPrincipal(principal *m.MSPPrincipal) error
type NymSignatureVerifier ¶
func (*NymSignatureVerifier) Verify ¶
func (v *NymSignatureVerifier) Verify(message, sigma []byte) error
type RoleAttribute ¶
type RoleAttribute int32
RoleAttribute : Represents a IdemixRole
const ( MEMBER RoleAttribute = 1 ADMIN RoleAttribute = 2 CLIENT RoleAttribute = 4 PEER RoleAttribute = 8 )
The expected roles are 4; We can combine them using a bitmask
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 */
// 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