Documentation ¶
Index ¶
- Constants
- func AESDecrypt(data []byte, passphrase string) ([]byte, error)
- func AESEncrypt(data []byte, passphrase string) []byte
- func Decode(src string) string
- func Encode(data []byte) string
- func Hash(b []byte, hashType int) []byte
- func MD5(data string) string
- func SHA1(data string) string
- func SHA256(data string) string
- func SHA512(data string) string
- type ECDSASignature
- type Envelope
- type MessageBody
Constants ¶
View Source
const ( HashMD5 = 0 HashSHA1 = 1 HashSHA256 = 3 //384 HashSHA512 = 6 )
Hash Type
Variables ¶
This section is empty.
Functions ¶
func AESEncrypt ¶
Types ¶
type ECDSASignature ¶
Represents the two mathematical components of an ECDSA signature once decomposed.
type Envelope ¶
type Envelope struct { RawMessage json.RawMessage `json:"message"` Message interface{} `json:"-"` Signature string `json:"signature"` }
Encapsulates the overall message we're trying to decode and validate.
func NewEnvelopeFromJSON ¶
Attempts to create a new envelope structure from the given JSON string.
type MessageBody ¶
type MessageBody struct { Type string `json:"type"` UserID uint32 `json:"userId"` Transaction json.RawMessage `json:"transaction"` }
The body of the message to be contained in the Message field of our Envelope structure.
Click to show internal directories.
Click to hide internal directories.