diff options
Diffstat (limited to 'xmldsig.go')
| -rw-r--r-- | xmldsig.go | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/xmldsig.go b/xmldsig.go new file mode 100644 index 0000000..663f147 --- /dev/null +++ b/xmldsig.go @@ -0,0 +1,53 @@ +package libebics + +import "encoding/xml" + +type DSIGX509Data struct { + XMLName xml.Name `xml:"ds:X509Data"` + DSIGX509Certificate string `xml:"ds:X509Certificate"` // TODO Properly marshal this +} + +type DSIGSignatureType struct { + SignedInfo DSIGSignedInfo `xml:"ds:SignedInfo"` + SignatureValue string `xml:"ds:SignatureValue"` // TODO Properly marshal this +} + +type DSIGSignedInfo struct { + XMLName xml.Name `xml:"ds:SignedInfo"` + CanonicalizationMethod DSIGCanonicalizationMethod `xml:"ds:CanonicalizationMethod"` + SignatureMethod DSIGSignatureMethod `xml:"ds:SignatureMethod"` + Reference DSIGReference `xml:"ds:Reference"` +} + +type DSIGCanonicalizationMethod struct { + XMLName xml.Name `xml:"ds:CanonicalizationMethod"` + Algorithm string `xml:"Algorithm,attr"` +} + +type DSIGSignatureMethod struct { + XMLName xml.Name `xml:"ds:SignatureMethod"` + Algorithm string `xml:"Algorithm,attr"` +} + +type DSIGReference struct { + XMLName xml.Name `xml:"ds:Reference"` + URI string `xml:"URI,attr"` + Transforms DSIGTransforms `xml:"ds:Transforms"` + DigestMethod DSIGDigestMethod `xml:"ds:DigestMethod"` + DigestValue string `xml:"ds:DigestValue"` +} + +type DSIGTransforms struct { + XMLName xml.Name `xml:"ds:Transforms"` + Transform DSIGTransform `xml:"ds:Transform"` // TODO make proper list +} + +type DSIGTransform struct { + XMLName xml.Name `xml:"ds:Transform"` + Algorithm string `xml:"Algorithm,attr"` +} + +type DSIGDigestMethod struct { + XMLName xml.Name `xml:"ds:DigestMethod"` + Algorithm string `xml:"Algorithm,attr"` +} |
