Documentation ¶
Index ¶
- Constants
- func AssertAdmin(ctx contractapi.TransactionContextInterface) error
- func CertificateAlreadyExists(ctx contractapi.TransactionContextInterface, certPemBase64 string, ...) (bool, error)
- func CheckAttr(name, value string, attrs *attrmgr.Attributes) (bool, error)
- func CheckSignatureFrom(certRoot []byte, certIssue []byte) error
- func CompareCertsPemBase64(cert1, cert2 string) bool
- func ConcatenateBytes(data ...[]byte) []byte
- func ConstructQueryResponseFromIterator(resultsIterator shim.StateQueryIteratorInterface) ([]interface{}, error)
- func Contains(arr []string, elem string) bool
- func CreateIndex(stub shim.ChaincodeStubInterface, indexName string, attributes []string) error
- func DeepCopy(v interface{}) (interface{}, error)
- func DeleteIndex(stub shim.ChaincodeStubInterface, indexName string, attributes []string, ...) error
- func DidFormat(hashPubKey string) string
- func FunctionCompare(f1, f2 string) (bool, error)
- func GenerateUUIDBytes() []byte
- func GenerateUUIDFormatDate(stub shim.ChaincodeStubInterface) string
- func GenerateUUIDStr() string
- func GetAttrsNonStandardCert(certPem []byte) (map[string]string, error)
- func GetBoolOrDefault(value string, defaultVal bool) bool
- func GetDateCertificate(cert *x509.Certificate) map[string]string
- func GetEnvOrDefault(env, defaultVal string) string
- func GetPublicKey(cert *x509.Certificate) (string, error)
- func GetQueryResultForQueryString(ctx contractapi.TransactionContextInterface, queryString string) ([]interface{}, error)
- func GetQueryResultForQueryStringWithPagination(ctx contractapi.TransactionContextInterface, queryString string, ...) (*model.PaginatedQueryResponse, error)
- func GetTxTimestampRFC3339(stub shim.ChaincodeStubInterface) (string, error)
- func GetX509CertFromPem(certPemBase64 string) (*x509.Certificate, error)
- func GetX509CertFromPemByte(certPem []byte) (*x509.Certificate, error)
- func HasExpired(cert *x509.Certificate) error
- func MapToSlice(dMap map[string]string) []string
- func NormalizeString(text string) string
- func ParseRFC3339toTime(tm string) (time.Time, error)
- func SliceToMap(slice []string, dMap map[string]string)
- func ToChaincodeArgs(args ...string) [][]byte
- func UpdateJSON(request interface{}, stateDB interface{}) ([]byte, error)
- func VerifyIssuedByRootCert(certRoot []byte, certIssue []byte) error
- func VerifySignature(message string, key string) ([]byte, error)
- type BeforeTransactionUnmarshalResponse
Constants ¶
const ( ErrorParseJWS = `error parsing into JWS` ErrorParseX509 = `error parsing into X509` ErrorBase64 = `error decoding into base64` ErrorVerifying = `error verifying signature` ErrorGetMSPID = `failed getting the client's MSPID: %v` ErrorGetIdentity = `failed to get identity %s` ErrorUpdateIdentity = `failed to update identity %s` ErrorIdentityExists = `identity %s already exists` ErrorDefaultNotExist = `%s does not exist` ErrorRequiredParameter = "a required parameter (%s) was not provided" )
Error responses errorXXX occurs when XXX
Variables ¶
This section is empty.
Functions ¶
func AssertAdmin ¶
func AssertAdmin(ctx contractapi.TransactionContextInterface) error
func CertificateAlreadyExists ¶
func CertificateAlreadyExists(ctx contractapi.TransactionContextInterface, certPemBase64 string, indexName string, attributes []string) (bool, error)
CertificateAlreadyExists check if the certificate already exists in the world-state deprecated: Certificates will be stored in ledger, only public key
Arguments:
0: certPemBase64 - certificate to validate 1: indexName - 2: attributes -
Returns:
0: bool 1: error
func CheckAttr ¶
func CheckAttr(name, value string, attrs *attrmgr.Attributes) (bool, error)
CheckAttr return value for a certificate attribute or check the value of an attribute
func CheckSignatureFrom ¶
CheckSignatureFrom verifies that the signature on certIssue is a valid signature from Root Cert.
func CompareCertsPemBase64 ¶
func ConcatenateBytes ¶
ConcatenateBytes is useful for combining multiple arrays of bytes, especially for signatures or digests over multiple fields
func ConstructQueryResponseFromIterator ¶
func ConstructQueryResponseFromIterator(resultsIterator shim.StateQueryIteratorInterface) ([]interface{}, error)
ConstructQueryResponseFromIterator constructs a slice of assets from the resultsIterator
func CreateIndex ¶
func CreateIndex(stub shim.ChaincodeStubInterface, indexName string, attributes []string) error
CreateIndex create search index for ledger
Arguments:
0: indexName - 1: attributes -
Returns:
0: error
func DeleteIndex ¶
func DeleteIndex(stub shim.ChaincodeStubInterface, indexName string, attributes []string, validateDelState bool) error
DeleteIndex remove search index for ledger
Arguments:
0: indexName - 1: attributes -
Returns:
0: error
func FunctionCompare ¶
FunctionCompare compares one function name with another, the input parameter can be in the form "org.tecnomatica.participant:GetParticipant"
func GenerateUUIDBytes ¶
func GenerateUUIDBytes() []byte
GenerateUUIDBytes returns a UUID based on RFC 4122 returning the generated bytes
func GenerateUUIDFormatDate ¶
func GenerateUUIDFormatDate(stub shim.ChaincodeStubInterface) string
func GenerateUUIDStr ¶
func GenerateUUIDStr() string
GenerateUUIDStr returns a UUID based on RFC 4122
func GetAttrsNonStandardCert ¶
func GetBoolOrDefault ¶
GetBoolOrDefault Note that the method returns default value if the string cannot be parsed!
func GetDateCertificate ¶
func GetDateCertificate(cert *x509.Certificate) map[string]string
GetDateCertificate returns the issue and expiration date of a certificate
func GetEnvOrDefault ¶
func GetPublicKey ¶
func GetPublicKey(cert *x509.Certificate) (string, error)
func GetQueryResultForQueryString ¶
func GetQueryResultForQueryString(ctx contractapi.TransactionContextInterface, queryString string) ([]interface{}, error)
GetQueryResultForQueryString executes the passed in query string. The result set is built and returned as a byte array containing the JSON results.
func GetQueryResultForQueryStringWithPagination ¶
func GetQueryResultForQueryStringWithPagination(ctx contractapi.TransactionContextInterface, queryString string, pageSize int32, bookmark string) (*model.PaginatedQueryResponse, error)
GetQueryResultForQueryStringWithPagination executes the passed in query string with pagination info. The result set is built and returned as a byte array containing the JSON results.
func GetTxTimestampRFC3339 ¶
func GetTxTimestampRFC3339(stub shim.ChaincodeStubInterface) (string, error)
func GetX509CertFromPem ¶
func GetX509CertFromPem(certPemBase64 string) (*x509.Certificate, error)
GetX509CertFromPem use to validate cert
func GetX509CertFromPemByte ¶
func GetX509CertFromPemByte(certPem []byte) (*x509.Certificate, error)
GetX509CertFromPemByte use to validate cert
func HasExpired ¶
func HasExpired(cert *x509.Certificate) error
func MapToSlice ¶
func SliceToMap ¶
func ToChaincodeArgs ¶
ToChaincodeArgs converts string args to []byte args
func UpdateJSON ¶
func VerifyIssuedByRootCert ¶
VerifyIssuedByRootCert Verify cert issued by Root Certificate.