Documentation
¶
Index ¶
- Constants
- func CheckAddress(address string) error
- func CheckDuplicates(arr []string) error
- func CheckKeysArr(keysArr []string) error
- func DecodeAndSort(item string) ([][]byte, error)
- func DecodeBase58PublicKey(encodedBase58PublicKey string) ([]byte, error)
- func DefaultPublicKeyType() string
- func IsValidator(validators []*aclproto.ACLValidator, pk string) bool
- func KeyStringToSortedHashedHex(keys []string) (string, error)
- func ParseCCName(stub shim.ChaincodeStubInterface) (string, error)
- func ToLowerFirstLetter(in string) string
- func ValidateKeyLength(key []byte) bool
- func ValidateMinSignatures(n int) error
- func ValidatePublicKeyType(keyType string, notAllowedTypes ...string) bool
Constants ¶
const ( KeyLengthEd25519 = 32 KeyLengthSecp256k1 = 65 KeyLengthGOST = 64 )
const MinSignaturesRequired = 1
MinSignaturesRequired defines the minimum number of signatures required for a multisignature transaction.
const PrefixUncompressedSecp259k1Key = 0x04
Variables ¶
This section is empty.
Functions ¶
func CheckAddress ¶
CheckAddress verifies length of given address
func CheckDuplicates ¶
CheckDuplicates checks a string array for duplicates. It returns an error if duplicates are found, indicating the first duplicated item encountered.
func CheckKeysArr ¶
CheckKeysArr checks keys if not empty or having duplicates
func DecodeAndSort ¶
DecodeAndSort returns decoded and sorted collection
func DecodeBase58PublicKey ¶
DecodeBase58PublicKey decode public key from base58 to a byte array
func DefaultPublicKeyType ¶
func DefaultPublicKeyType() string
func IsValidator ¶
func IsValidator(validators []*aclproto.ACLValidator, pk string) bool
IsValidator checks whether a public key belongs to authorized entities and returns true or false
func KeyStringToSortedHashedHex ¶
KeyStringToSortedHashedHex returns keys encoded to sorted hashed hex
func ParseCCName ¶
func ParseCCName(stub shim.ChaincodeStubInterface) (string, error)
ParseCCName returns chaincode name from proposal
func ToLowerFirstLetter ¶
ToLowerFirstLetter returns string with first letter in lower case
func ValidateKeyLength ¶
func ValidateMinSignatures ¶
ValidateMinSignatures checks that the number of required signatures is greater than the minimum allowed value. It returns an error if the number of required signatures is less than or equal to the minimum allowed value.
func ValidatePublicKeyType ¶
Types ¶
This section is empty.