RealmeGOSDK

package module
v0.0.0-...-35c9ad0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 18 Imported by: 0

README

Realme-GO-SDK

example

package main

import (
    "./Realme-GO-SDK"
    "io/ioutil"
    "fmt"
)

func main() {
    xmldata,_ := ioutil.ReadFile("./Realme-GO-SDK/samlResponse.txt")
    RSAPrivateKey,_ := ioutil.ReadFile("./Realme-GO-SDK/private_key.txt")
    output := RealmeGOSDK.GetResponseDecryptedContent(xmldata,RSAPrivateKey)
    fmt.Println(output.StatusCode)
    fmt.Println(output.NameID)
}

Documentation

Index

Constants

View Source
const (
	DSAwithSHA1 = "http://www.w3.org/2000/09/xmldsig#dsa-sha1"
	RSAwithSHA1 = "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
)

Variables

This section is empty.

Functions

func GetQueryString

func GetQueryString(sigAlg string, relayState string) string

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

*

  • 删除AES加密前的Padding

Types

type DecryptedResponse

type DecryptedResponse struct {
	StatusCode string
	NameID     string
}

func GetResponseDecryptedContent

func GetResponseDecryptedContent(data, RSAPrivateKey []byte) DecryptedResponse

*

  • SDK的主入口,输入xml的内容,返回解密后的DecryptedResponse

type ResponseContent

type ResponseContent struct {
	AESEncryptedContent string
	AESKey              string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL