packager

package
v0.0.0-...-d32b6b0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressedEncodedSignedString

func CompressedEncodedSignedString(data interface{}, privateKeyPath string) (string, error)

CompressedEncodedSignedString sign xml document, compress, then base64 encode the xml document

func CompressedEncodedSignedStringFromKey

func CompressedEncodedSignedStringFromKey(data interface{}, key string) (string, error)

CompressedEncodedSignedStringFromKey sign string with sp key, compress, then base64 encode the xml document

func CompressedEncodedString

func CompressedEncodedString(data interface{}) (string, error)

CompressedEncodedString compress, then base64 encode the xml document

func DecodeAndInflateString

func DecodeAndInflateString(data string) ([]byte, error)

DecodeAndInflateString base64 decode and inflate string

func DecodeString

func DecodeString(data string) ([]byte, error)

DecodeString base64 decode string

func DeflateAndEncodeString

func DeflateAndEncodeString(data []byte) string

DeflateAndEncodeString deflate string then base 64 encode

func EncodeString

func EncodeString(data []byte) string

EncodeString base64 encode string

func EncodedSignedString

func EncodedSignedString(data interface{}, privateKeyPath string) (string, error)

EncodedSignedString get base64 encoded, xml signed string representation of xml document

func EncodedString

func EncodedString(data interface{}) (string, error)

EncodedString base64 encode xml document

func Sign

func Sign(xml string, privateKeyPath string) (string, error)

Sign creates a signature for an XML document and returns it

func SignWithKey

func SignWithKey(xml string, pemKey string) (string, error)

SignWithKey create signature for xml document using pem formatted string representing x509 key. Returns signed xml document.

func SignedString

func SignedString(data interface{}, privateKeyPath string) (string, error)

SignedString sign the xml document and return string representation

func String

func String(data interface{}) (string, error)

String get string representation of xml document

func Verify

func Verify(xml string, publicCertPath string) error

Verify validates the signature of an XML document

func VerifyWithCert

func VerifyWithCert(xml string, certPem string) error

VerifyWithCert validate xml document using pem formatted string

Types

type CanonicalizationMethod

type CanonicalizationMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

CanonicalizationMethod TODO needs description

type DigestMethod

type DigestMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

DigestMethod algorithm used to create signature digest

type DigestValue

type DigestValue struct {
	XMLName xml.Name
}

DigestValue resulting signature digest

type KeyInfo

type KeyInfo struct {
	XMLName  xml.Name
	X509Data X509Data `xml:",innerxml"`
}

KeyInfo key information for signature

func GetKeyInfoEntity

func GetKeyInfoEntity(namespace string) KeyInfo

GetKeyInfoEntity for specified namespace

type SamlsigReference

type SamlsigReference struct {
	XMLName      xml.Name
	URI          string       `xml:"URI,attr"`
	Transforms   Transforms   `xml:",innerxml"`
	DigestMethod DigestMethod `xml:",innerxml"`
	DigestValue  DigestValue  `xml:",innerxml"`
}

SamlsigReference TODO needs description

type Signature

type Signature struct {
	XMLName        xml.Name
	ID             string `xml:"Id,attr"`
	SignedInfo     SignedInfo
	SignatureValue SignatureValue
	KeyInfo        KeyInfo
}

Signature xml signature

func GetSignatureEntity

func GetSignatureEntity(id string) *Signature

GetSignatureEntity get an xml signature entity

type SignatureMethod

type SignatureMethod struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

SignatureMethod Algorithm for signature

type SignatureValue

type SignatureValue struct {
	XMLName xml.Name
	Value   string `xml:",innerxml"`
}

SignatureValue signature information data

type SignedInfo

type SignedInfo struct {
	XMLName                xml.Name
	CanonicalizationMethod CanonicalizationMethod
	SignatureMethod        SignatureMethod
	SamlsigReference       SamlsigReference
}

SignedInfo xml signature information

type Transform

type Transform struct {
	XMLName   xml.Name
	Algorithm string `xml:"Algorithm,attr"`
}

Transform algorithm transform for signature

type Transforms

type Transforms struct {
	XMLName   xml.Name
	Transform Transform
}

Transforms set of transforms applied to signature

type X509Certificate

type X509Certificate struct {
	XMLName xml.Name
	Cert    string `xml:",innerxml"`
}

X509Certificate X.509 formatted certificate

type X509Data

type X509Data struct {
	XMLName         xml.Name
	X509Certificate X509Certificate `xml:",innerxml"`
}

X509Data X.509 formatted data

Jump to

Keyboard shortcuts

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