Documentation
¶
Index ¶
- func Base64Decode(_base64 string) (string, error)
- func Base64Encode(str string) string
- func BytesToHexString(b []byte) string
- func BytesToString(data []byte) string
- func ComparePassword(userPassword string, password string) bool
- func Copy(toValue interface{}, fromValue interface{}) (err error)
- func CreateECDSAPrivateKey(D *big.Int, curve elliptic.Curve) (*ecdsa.PrivateKey, error)
- func CreateECDSAPublicKey(curve elliptic.Curve, x *big.Int, y *big.Int) (*ecdsa.PublicKey, error)
- func DecryptCipherText(cipherText []byte, privateKey *rsa.PrivateKey, ...) ([]byte, error)
- func EncodeKeyPair(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) (string, string)
- func EncodeRSAKeyPair(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) (string, string)
- func EncryptMessage(message []byte, publicKey *rsa.PublicKey, options *MessageEncryptionOptions) ([]byte, error)
- func GenerateDID(did string, method string) string
- func GenerateKeyPairWithOption(option *GenerateKeyPairOption) (interface{}, error)
- func GetArrayString(v []*string) []string
- func GetBigNumber(n string) (*big.Int, bool)
- func GetBool(v *bool) bool
- func GetBoolFalse(v *bool) bool
- func GetBoolTrue(v *bool) bool
- func GetCurrentDateTime() *time.Time
- func GetFloat64(v *float64) float64
- func GetInt(v *int) int
- func GetInt64(v *int64) int64
- func GetJSON(v *json.RawMessage) json.RawMessage
- func GetMD5Hash(text string) string
- func GetString(v *string) string
- func GetUUID() string
- func HashPassword(password string) (*string, error)
- func HexToBytesString(data string) ([]byte, error)
- func IsEmpty(x interface{}) bool
- func IsExists(db *gorm.DB, field *string, table string, column string, fieldPath string) (bool, error)
- func IsExistsWithCondition(db *gorm.DB, table string, condition map[string]interface{}, fieldPath string) (bool, error)
- func IsStrIn(input *string, rules string, fieldPath string) (bool, error)
- func IsUUID(str string) bool
- func JSONParse(body []byte, model interface{}) error
- func JSONToString(s interface{}) string
- func JWTDecode(token string) (string, error)
- func LoadPrivateKey(privateKey string) (*ecdsa.PrivateKey, error)
- func LoadPublicKey(publicKey string) (*ecdsa.PublicKey, error)
- func LoadRSAPrivateKey(privateKey string) (*rsa.PrivateKey, error)
- func LoadRSAPublicKey(publicKey string) (*rsa.PublicKey, error)
- func LogStruct(v interface{})
- func MapToStruct(src interface{}, to interface{}) error
- func MockExplorer()
- func NewSha256(str string) string
- func NewSha384(str string) string
- func NewSha512(str string) string
- func RootDir() string
- func SignMessage(privateKey *ecdsa.PrivateKey, message string) (string, error)
- func SignMessageWithOption(privateKey interface{}, message string, option *SignMessageOption) (string, error)
- func StringToBytes(data string) []byte
- func StructToHexString(s interface{}) string
- func StructToMap(src interface{}) (map[string]interface{}, error)
- func StructToString(v interface{}) string
- func StructToStringNoPretty(v interface{}) string
- func ToNonPointer[T comparable](v *T) T
- func ToPointer[T comparable](v T) *T
- func ToUUID(str string) (uuid.UUID, error)
- func VerifySignature(publicKey string, signature string, msg string) (bool, error)
- func VerifySignatureWithOption(publicKey string, signature string, msg string, option *VerifySignatureOption) (bool, error)
- type Consensus
- type DIDDetail
- type ECDSASignature
- type GenerateKeyPairOption
- type KeyPair
- type MessageEncryptionOptions
- type NewKey
- type RSAKeyPair
- type RSAKeySize
- type SignMessageOption
- type VerifySignatureOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶ added in v1.2.0
func Base64Encode ¶ added in v1.2.0
func BytesToHexString ¶ added in v1.2.0
func BytesToString ¶ added in v1.2.0
func ComparePassword ¶ added in v1.2.0
func CreateECDSAPrivateKey ¶ added in v1.2.0
func CreateECDSAPublicKey ¶ added in v1.2.0
func DecryptCipherText ¶ added in v1.2.0
func DecryptCipherText(cipherText []byte, privateKey *rsa.PrivateKey, options *MessageEncryptionOptions) ([]byte, error)
func EncodeKeyPair ¶ added in v1.2.0
func EncodeRSAKeyPair ¶ added in v1.2.0
func EncryptMessage ¶ added in v1.2.0
func GenerateDID ¶ added in v1.2.0
func GenerateKeyPairWithOption ¶ added in v1.2.0
func GenerateKeyPairWithOption(option *GenerateKeyPairOption) (interface{}, error)
func GetArrayString ¶ added in v1.1.0
func GetBoolFalse ¶ added in v1.1.0
func GetBoolTrue ¶ added in v1.1.0
func GetCurrentDateTime ¶ added in v1.2.0
func GetFloat64 ¶ added in v1.1.0
func GetJSON ¶ added in v1.1.0
func GetJSON(v *json.RawMessage) json.RawMessage
func GetMD5Hash ¶ added in v1.2.0
func HashPassword ¶ added in v1.2.0
func HexToBytesString ¶ added in v1.2.0
func IsExistsWithCondition ¶ added in v1.2.0
func JSONToString ¶ added in v1.2.0
func JSONToString(s interface{}) string
func LoadPrivateKey ¶ added in v1.2.0
func LoadPrivateKey(privateKey string) (*ecdsa.PrivateKey, error)
func LoadRSAPrivateKey ¶ added in v1.2.0
func LoadRSAPrivateKey(privateKey string) (*rsa.PrivateKey, error)
func LoadRSAPublicKey ¶ added in v1.2.0
func MapToStruct ¶ added in v1.2.0
func MapToStruct(src interface{}, to interface{}) error
func MockExplorer ¶ added in v1.2.0
func MockExplorer()
func SignMessage ¶ added in v1.2.0
func SignMessage(privateKey *ecdsa.PrivateKey, message string) (string, error)
func SignMessageWithOption ¶ added in v1.2.0
func SignMessageWithOption(privateKey interface{}, message string, option *SignMessageOption) (string, error)
func StringToBytes ¶ added in v1.2.0
func StructToHexString ¶ added in v1.2.0
func StructToHexString(s interface{}) string
func StructToMap ¶ added in v1.2.0
func StructToString ¶
func StructToString(v interface{}) string
func StructToStringNoPretty ¶ added in v1.2.0
func StructToStringNoPretty(v interface{}) string
func ToNonPointer ¶ added in v1.1.0
func ToNonPointer[T comparable](v *T) T
func ToPointer ¶ added in v1.1.0
func ToPointer[T comparable](v T) *T
func VerifySignature ¶ added in v1.2.0
func VerifySignatureWithOption ¶ added in v1.2.0
Types ¶
type Consensus ¶ added in v1.2.0
func ConvertConsensus ¶ added in v1.2.0
type DIDDetail ¶ added in v1.2.0
func ExtractDID ¶ added in v1.2.0
type ECDSASignature ¶ added in v1.2.0
type GenerateKeyPairOption ¶ added in v1.2.0
type GenerateKeyPairOption struct { Algorithm x509.SignatureAlgorithm KeySize RSAKeySize }
type KeyPair ¶ added in v1.2.0
type KeyPair struct { PublicKeyPem string PrivateKeyPem string PrivateKey *ecdsa.PrivateKey }
func GenerateKeyPair ¶ added in v1.2.0
type MessageEncryptionOptions ¶ added in v1.2.0
type NewKey ¶ added in v1.2.0
type NewKey struct { Controller *string `json:"controller"` KeyPem string `json:"key_pem"` KeyHash string `json:"key_hash"` KeyType string `json:"key_type"` Signature string `json:"signature"` }
func ConvertNewKey ¶ added in v1.2.0
type RSAKeyPair ¶ added in v1.2.0
type RSAKeyPair struct { PublicKeyPem string PrivateKeyPem string PrivateKey *rsa.PrivateKey }
type RSAKeySize ¶ added in v1.2.0
type RSAKeySize int
const ( EncryptRSA2048Bits RSAKeySize = iota EncryptRSA4096Bits )
type SignMessageOption ¶ added in v1.2.0
type SignMessageOption struct {
Algorithm x509.SignatureAlgorithm
}
type VerifySignatureOption ¶ added in v1.2.0
type VerifySignatureOption struct {
Algorithm x509.SignatureAlgorithm
}
Click to show internal directories.
Click to hide internal directories.