xmlutils

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWhitespace

func IsWhitespace(s string) bool

IsWhitespace returns true if the byte slice contains only whitespace characters.

func ProcessNodesRecursive

func ProcessNodesRecursive(node *etree.Element, processToken TokenProcessor)

func StripWhitespace

func StripWhitespace(document *etree.Document)

func XMLDigitalSignatureC14NTransform

func XMLDigitalSignatureC14NTransform(xmlText string, stripComments bool, stripWhitespace bool) (*etree.Document, error)

XMLDigitalSignatureC14NTransform will perform a canonical transform on an XML string and return an XMLDocument object. See these links for more details https://www.w3.org/TR/xml-exc-c14n/ https://www.w3.org/TR/xml-exc-c14n/#ref-XML-C14N

func XMLDocument

func XMLDocument(xml string) (*etree.Document, error)

XMLDocument parses an XML string and returns a virtual DOM

Types

type TokenProcessor

type TokenProcessor func(node etree.Token)

type XMLDigestSignature

type XMLDigestSignature struct {
	Doc                                   *etree.Document
	MessageDigestElementPath              string
	MessageDigestSignatureKey             string
	MessageDigestSignatureEncoding        string
	MessageDigestSignatureRootElementPath string
	MessageDigestSignatureAlgorithm       string
	Pretty                                bool
}

func (*XMLDigestSignature) Inject

func (d *XMLDigestSignature) Inject(generateSignature XMLDigestSigner) error

Inject executes a callback which receives the canonicalXML for which a signature should be generated and expects a returned string

type XMLDigestSigner

type XMLDigestSigner func(tree *etree.Document, document, signatureAlg, signatureKey, encodingFormat string) (string, error)

XMLDigestSigner a callback function to generate a cryptographic signature given a canonical document

Jump to

Keyboard shortcuts

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