Documentation
¶
Index ¶
- Variables
- func Canonicalise(xmlString string) (string, error)
- func GenerateSHA256Hash(val string) ([]byte, error)
- func GetElementByName(element *etree.Element, tag string) *etree.Element
- func MarshallToXML(data interface{}) (string, error)
- func VerifySignature(xml string) bool
- type Algorithm
- type KeyInfo
- type Reference
- type Sgntr
- type Signature
- type SignedInfo
- type Transforms
- type X509Data
- type XmlWriteCloser
Constants ¶
This section is empty.
Variables ¶
var LOGGER = logging.MustGetLogger("xmldsig")
Functions ¶
func Canonicalise ¶
Canonicalise the XML based on W3C standard, using another library
func GenerateSHA256Hash ¶
func MarshallToXML ¶
func VerifySignature ¶
Types ¶
type Algorithm ¶
type Algorithm struct {
Algorithm string `xml:",attr"`
}
Algorithm describes the digest or signature used when digest or signature.
type KeyInfo ¶
type KeyInfo struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"` X509Data *X509Data Children []interface{} }
KeyInfo is an optional element that enables the recipient(s) to obtain the key needed to validate the signature.
type Reference ¶
type Reference struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Reference"` URI string `xml:",attr,omitempty"` Transforms Transforms DigestMethod Algorithm `xml:"http://www.w3.org/2000/09/xmldsig# DigestMethod"` DigestValue string `xml:"http://www.w3.org/2000/09/xmldsig# DigestValue"` }
Reference specifies a digest algorithm and digest value, and optionally an identifier of the object being signed, the type of the object, and/or a list of transforms to be applied prior to digesting.
type Sgntr ¶
type Sgntr struct { XMLName xml.Name `xml:"urn:iso:std:iso:20022:tech:xsd:head.001.001.01 Sgntr"` Signature Signature }
Signature element is the root element of an XML Signature.
func NewSignature ¶
func NewSignature() *Sgntr
type Signature ¶
type Signature struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Signature"` SignedInfo SignedInfo SignatureValue string `xml:"http://www.w3.org/2000/09/xmldsig# SignatureValue"` KeyInfo KeyInfo }
type SignedInfo ¶
type SignedInfo struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# SignedInfo"` CanonicalizationMethod Algorithm `xml:"http://www.w3.org/2000/09/xmldsig# CanonicalizationMethod"` SignatureMethod Algorithm `xml:"http://www.w3.org/2000/09/xmldsig# SignatureMethod"` Reference Reference }
SignedInfo includes a canonicalization algorithm, a signature algorithm, and a reference.
type Transforms ¶
type Transforms struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# Transforms"` Transform []Algorithm `xml:"http://www.w3.org/2000/09/xmldsig# Transform"` }
Transforms is an optional ordered list of processing steps that were applied to the resource's content before it was digested.
type X509Data ¶
type X509Data struct { XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# X509Data"` X509Certificate string `xml:"http://www.w3.org/2000/09/xmldsig# X509Certificate"` }
X509Data element within KeyInfo contains one an X509 certificate
type XmlWriteCloser ¶
The C14N library expect a WriteCloser type
func (XmlWriteCloser) Close ¶
func (XmlWriteCloser) Close() error
Implement the Close() method of the WriteCloser Interface