Documentation ¶
Index ¶
- Variables
- func Base64UrlEncodedDataByJSON(jsonData map[string]interface{}) string
- func CalculateSHA256(dataBytes *[]byte) string
- func CalculateSHA3_256(dataBytes *[]byte) string
- func CalculateShake256(dataBytes *[]byte) string
- func CheckValidLanguage(language interface{}) bool
- func CheckValidLocalizedText(localizedText string) bool
- func CheckValidMultipleLocalizedTexts(inputStr string) bool
- func ComputeIndexedAttributeByHmacKey(hmacKey []byte, attributeName, attributeValue string) (string, string)
- func ComputeMAC(message, key []byte) []byte
- func Contains(slice []string, item string) bool
- func ConvertBytesToRawJson(bytes *[]byte) (result json.RawMessage, errMsg string)
- func GetMultihashBase58(inputBytes *[]byte, hashName string) string
- func GetMultihashSHA256Base58(inputBytes *[]byte) string
- func GetVerifiedLocalizedText(localizedText string) string
- func InterfaceToMap(i interface{}) (map[string]interface{}, error)
- func NewMultibase58UUIDv4() string
- func StringToStringsArray(spaceSeparatedString *string) []string
- func StringsArrayByConcatenatedString(concatenatedString *string, concatenationSymbol string) []string
- func StringsArrayToString(stringsSlice *[]string) string
- func StringsSliceContainsString(slice []string, strValue string) bool
- func StringsSliceHasStringMember(slice []string, strValue string) bool
- func ValidMAC(message, messageMAC, key []byte) bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CalculateSHA256 ¶
CalculateSHA256 is used to generate the Thumbprint of a public JSON Web Key (JWK).
func CalculateSHA3_256 ¶
CalculateSHA3_256 is used to generate the H(pk) in Crystals-Kyber
func CalculateShake256 ¶
CalculateShake256 is used to generate "xs" & "ds" in Crystals-Dilithium
func CheckValidLanguage ¶
func CheckValidLanguage(language interface{}) bool
func CheckValidLocalizedText ¶
CheckValidLocalizedText accepts "urn:ietf:bcp:47|<language>|<text>" but also "bcp:47|<language>|<text>" and "<language>|<text>" are allowed.
func ComputeIndexedAttributeByHmacKey ¶ added in v1.0.4
func ComputeIndexedAttributeByHmacKey(hmacKey []byte, attributeName, attributeValue string) (string, string)
returns protected attribute name and value, raw Base64Url encoded (without padding characters '=')
func ComputeMAC ¶
ComputeMAC creates a message authentication code (MAC), sometimes known as a "tag", which is a short piece of information used for authenticating a message, by using some deterministic data (the traditional "key" concept) which authenticates the origin of the message, where the deterministic data (key) serves to regenerate the expected MAC (tag) for the original message. In other words, to confirm a tag matches with the expected data and key (its authenticity).
func ConvertBytesToRawJson ¶
func ConvertBytesToRawJson(bytes *[]byte) (result json.RawMessage, errMsg string)
func GetMultihashBase58 ¶
Multihash is byte slice with the following form: <hash function code><digest size><hash function output>. See the spec for more information. B58String returns the B58-encoded representation of a multihash. Create a new multihash with the digest data.
func GetMultihashSHA256Base58 ¶
Multihash is byte slice with the following form: <hash function code><digest size><hash function output>. See the spec for more information. B58String returns the B58-encoded representation of a multihash. Create a new multihash with the digest data.
func GetVerifiedLocalizedText ¶
GetVerifiedLocalizedText returns empty string if wrong formatted instead of true or false
func InterfaceToMap ¶
func NewMultibase58UUIDv4 ¶
func NewMultibase58UUIDv4() string
NewMultibase58UUIDv4 returns an UUID v4 encoded as multi base58 BTC ("z" prefix). See https://tools.ietf.org/id/draft-multiformats-multibase-00.html#rfc.appendix.D.1
func StringToStringsArray ¶
StringToStringsArray splits the string around each instance of one or more consecutive white space characters
func StringsArrayByConcatenatedString ¶
func StringsArrayByConcatenatedString(concatenatedString *string, concatenationSymbol string) []string
StringToStringsArray splits the string around each instance of one or more consecutive white space characters
func StringsArrayToString ¶
StringsArrayToString converts a slice of strings to a string containing a space separated list of strings
func StringsSliceContainsString ¶
StringsSliceContainsString checks if a string is contained in some member of the slice
func StringsSliceHasStringMember ¶
StringsSliceContains checks if a string is equal to some member in the slice
Types ¶
This section is empty.