Documentation ¶
Overview ¶
Dervied from:
https://github.com/crewjam/go-xmlsec https://github.com/RobotsAndPencils/go-saml
Index ¶
- func Decrypt(cipher string, privateKey string) (string, error)
- func Encrypt(plaintext string, publicKey string) (string, error)
- func SignRaw(xml string, privateKey string) (string, error)
- func SignRequest(xml string, privateKey string) (string, error)
- func SignResponse(xml string, privateKey string) (string, error)
- func VerifyAssertionSignature(xml string, publicCert string) error
- func VerifyRequestSignature(xml string, publicCert string) error
- func VerifyResponseSignature(xml string, publicCert string) error
- type Method
- type Reference
- type Signature
- type SignatureX509Data
- type SignedInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignRequest ¶
SignRequest sign a SAML 2.0 AuthnRequest
func SignResponse ¶
SignResponse sign a SAML 2.0 Response
func VerifyAssertionSignature ¶
VerifyResponseSignature verify signature of a SAML 2.0 Assertion document
func VerifyRequestSignature ¶
VerifyRequestSignature verify signature of a SAML 2.0 AuthnRequest document
func VerifyResponseSignature ¶
VerifyResponseSignature verify signature of a SAML 2.0 Response document
Types ¶
type Signature ¶
type Signature struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Signature"` Id string `xml:"Id,attr"` SignedInfo SignedInfo `xml:"SignedInfo"` SignatureValue string `xml:"SignatureValue"` KeyName string `xml:"KeyInfo>KeyName,omitempty"` X509Certificate *SignatureX509Data `xml:"KeyInfo>X509Data,omitempty"` }
Signature is a model for the Signature object specified by XMLDSIG. This is convenience object when constructing XML that you'd like to sign. For example:
type Foo struct { Stuff string Signature Signature } f := Foo{Suff: "hello"} f.Signature = DefaultSignature() buf, _ := xml.Marshal(f) buf, _ = Sign(key, buf)
func DefaultSignature ¶
DefaultSignature returns a Signature struct that uses the default c14n and SHA1 settings.
type SignatureX509Data ¶
type SignatureX509Data struct {
X509Certificate string `xml:"X509Certificate,omitempty"`
}
SignatureX509Data represents the <X509Data> element of <Signature>
type SignedInfo ¶
Click to show internal directories.
Click to hide internal directories.