{"modulePath":"github.com/2lambda123/hyperledger-fabric","version":"v1.4.12","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cid\n\n## Functions\n\n```go\nfunc AssertAttributeValue(stub ChaincodeStubInterface, attrName, attrValue string) error\n```\nAssertAttributeValue checks to see if an attribute value equals the specified value\n\n```go\nfunc GetAttributeValue(stub ChaincodeStubInterface, attrName string) (value string, found bool, err error)\n```\nGetAttributeValue returns value of the specified attribute\n\n```go\nfunc GetID(stub ChaincodeStubInterface) (string, error)\n```\nGetID returns the ID associated with the invoking identity.  This ID is guaranteed to be unique within the MSP.\n\n```go\nfunc GetMSPID(stub ChaincodeStubInterface) (string, error)\n```\nGetMSPID returns the ID of the MSP associated with the identity that submitted the transaction\n\n```go\nfunc GetX509Certificate(stub ChaincodeStubInterface) (*x509.Certificate, error)\n```\nGetX509Certificate returns the X509 certificate associated with the client, or nil if it was not identified by an X509 certificate.\n\n## Types\n\n```go\ntype ChaincodeStubInterface interface {\n\t// GetCreator returns `SignatureHeader.Creator` (e.g. an identity)\n\t// of the `SignedProposal`. This is the identity of the agent (or user)\n\t// submitting the transaction.\n\tGetCreator() ([]byte, error)\n}\n```\nChaincodeStubInterface is used by deployable chaincode apps to get identity of the  agent (or user) submitting the transaction.\n\n```go\ntype ClientIdentity interface {\n\n\t// GetID returns the ID associated with the invoking identity.  This ID\n\t// is guaranteed to be unique within the MSP.\n\tGetID() (string, error)\n\n\t// Return the MSP ID of the client\n\tGetMSPID() (string, error)\n\n\t// GetAttributeValue returns the value of the client's attribute named `attrName`.\n\t// If the client possesses the attribute, `found` is true and `value` equals the\n\t// value of the attribute.\n\t// If the client does not possess the attribute, `found` is false and `value`\n\t// equals \"\".\n\tGetAttributeValue(attrName string) (value string, found bool, err error)\n\n\t// AssertAttributeValue verifies that the client has the attribute named `attrName`\n\t// with a value of `attrValue`; otherwise, an error is returned.\n\tAssertAttributeValue(attrName, attrValue string) error\n\n\t// GetX509Certificate returns the X509 certificate associated with the client,\n\t// or nil if it was not identified by an X509 certificate.\n\tGetX509Certificate() (*x509.Certificate, error)\n}\n```\nClientIdentity represents information about the identity that submitted the transaction\n\n```go\nfunc New(stub ChaincodeStubInterface) (ClientIdentity, error)\n```\nNew returns an instance of ClientIdentity\n\n","path":"github.com/2lambda123/hyperledger-fabric/core/chaincode/lib/cid","name":"cid","synopsis":"","isRedistributable":true}
