Documentation ¶
Index ¶
- Constants
- func GetAuthorizationHeader(reqProps APIParam) (string, error)
- func VerifyHMACSignature(message string, secret string, signature string) (bool, error)
- func VerifyRSASignature(message string, rsaPublicKey *rsa.PublicKey, base64Signature string) (bool, error)
- type APIParam
- type ArrayNameValuePair
- type TestParam
Constants ¶
View Source
const DEFAULT string = "default"
DEFAULT ()
View Source
const GOLANG string = "golang"
GOLANG ()
Variables ¶
This section is empty.
Functions ¶
func GetAuthorizationHeader ¶
GetAuthorizationHeader - Public function to get Apex Signature authorization token to be append on HTTP header
func VerifyHMACSignature ¶
VerifyHMACSignature - Verify HMAC256 signature given a basestring , app secret and signature It returns the HMAC256 signature
func VerifyRSASignature ¶
func VerifyRSASignature(message string, rsaPublicKey *rsa.PublicKey, base64Signature string) (bool, error)
VerifyRSASignature - Verify RSA256 signature given a basestring , corresponding public key and signature This is utilizing native PKCS 1.5 encryption standard It returns a boolean for the verification
Types ¶
type APIParam ¶
type APIParam struct { Realm string `json:"realm"` AppID string `json:"appId"` AuthPrefix string `json:"authPrefix"` Secret string `json:"secret"` InvokeURL string `json:"invokeUrl"` SignatureURL string `json:"signatureUrl"` HTTPMethod string `json:"httpMethod"` Signature string `json:"signature"` PrivateCertFileName string `json:"privateCertFileName"` Passphrase string SignatureMethod string `json:"signatureMethod"` Nonce string `json:"nonce"` Timestamp string `json:"timestamp"` Version string `json:"version"` QueryString map[string]interface{} `json:"queryString"` FormData map[string]interface{} `json:"formData"` }
APIParam - API Request parameters struct that instantiate the request options
type ArrayNameValuePair ¶
type ArrayNameValuePair struct {
// contains filtered or unexported fields
}
ArrayNameValuePair ()
func (ArrayNameValuePair) Stringify ¶
func (param ArrayNameValuePair) Stringify() string
Stringify - Stringify request parameters
type TestParam ¶
type TestParam struct { ID string `json:"id"` Description string `json:"description"` APIParam APIParam `json:"apiParam"` PublicCertFileName string `json:"publicCertFileName"` SkipTest []string `json:"skipTest"` Message string `json:"message"` Debug bool `json:"debug"` TestTag bool `json:"testTag"` ExpectedResult interface{} `json:"expectedResult"` ErrorTest bool `json:"errorTest"` }
TestParam ()
Click to show internal directories.
Click to hide internal directories.