xades

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Prefix    string = "xades"
	Namespace string = "http://uri.etsi.org/01903/v1.3.2#"
)
View Source
const (
	SignedPropertiesTag          string = "SignedProperties"
	SignedSignaturePropertiesTag string = "SignedSignatureProperties"
	SigningTimeTag               string = "SigningTime"
	SigningCertificateTag        string = "SigningCertificate"
	CertTag                      string = "Cert"
	IssuerSerialTag              string = "IssuerSerial"
	CertDigestTag                string = "CertDigest"
	QualifyingPropertiesTag      string = "QualifyingProperties"
)
View Source
const (
	SignatureTag              = "Signature"
	SignedInfoTag             = "SignedInfo"
	CanonicalizationMethodTag = "CanonicalizationMethod"
	SignatureMethodTag        = "SignatureMethod"
	ReferenceTag              = "Reference"
	TransformsTag             = "Transforms"
	TransformTag              = "Transform"
	DigestMethodTag           = "DigestMethod"
	DigestValueTag            = "DigestValue"
	SignatureValueTag         = "SignatureValue"
	KeyInfoTag                = "KeyInfo"
	X509DataTag               = "X509Data"
	X509CertificateTag        = "X509Certificate"
	InclusiveNamespacesTag    = "InclusiveNamespaces"
)

Tags

View Source
const (
	AlgorithmAttr  = "Algorithm"
	URIAttr        = "URI"
	DefaultIdAttr  = "ID"
	PrefixListAttr = "PrefixList"
)

Variables

This section is empty.

Functions

func DigestValue

func DigestValue(element *etree.Element, canonicalizer *Canonicalizer, hash crypto.Hash) (base64encoded string, err error)

DigestValue calculate hash for digest

Types

type AlgorithmID

type AlgorithmID string
const (
	EnvelopedSignatureAlgorithmId                  AlgorithmID = "http://www.w3.org/2000/09/xmldsig#enveloped-signature"
	CanonicalXML10ExclusiveWithCommentsAlgorithmId AlgorithmID = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
	CanonicalXML10ExclusiveAlgorithmId             AlgorithmID = "http://www.w3.org/2001/10/xml-exc-c14n#"
)

Supported canonicalization algorithms

func (AlgorithmID) String

func (id AlgorithmID) String() string

type Canonicalizer

type Canonicalizer interface {
	Canonicalize(el *etree.Element) ([]byte, error)
	Algorithm() AlgorithmID
}

func MakeC14N10ExclusiveCanonicalizerWithPrefixList

func MakeC14N10ExclusiveCanonicalizerWithPrefixList(prefixList string) Canonicalizer

type Config

type Config struct {
	Canonicalizer Canonicalizer
	IsEnveloped   bool
	Hash          crypto.Hash
	ReferenceURI  string
	SigningTime   time.Time
}

type Xades

type Xades interface {
	CreateSignature(signedData *etree.Element) (*etree.Element, error)
}

func New

func New(config Config, signer signer.Signer) Xades

func NewDefault

func NewDefault(signer signer.Signer) Xades

Jump to

Keyboard shortcuts

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