-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsig11.go
87 lines (73 loc) · 2.19 KB
/
dsig11.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package xmlsecurity
import (
"encoding/xml"
)
type (
Curve struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# Curve"`
A string
B string
}
DEREncodedKeyValue struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# DEREncodedKeyValue"`
Id string `xml:",attr,omitempty"`
Data string `xml:",chardata"`
}
ECKeyValue struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# ECKeyValue"`
Id string `xml:",attr,omitempty"`
NamedCurve *NamedCurve
ECParameters *ECParameters
PublicKey string
}
ECParameters struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# NamedCurve"`
FieldID FieldID
Curve Curve // TODO type="dsig11:CurveType"
Base string // base64 encoded
Order string // base64 encoded
CoFactor *int `xml:",omitempty"`
ValidationData *ValidationData `xml:",omitempty"`
}
FieldID struct {
Prime *Prime `xml:",omitempty"`
TnB *TnB `xml:",omitempty"`
PnB *PnB `xml:",omitempty"`
GnB *GnB `xml:",omitempty"`
Children []Node `xml:",any,omitempty"`
}
GnB struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# GnB"`
M uint
}
KeyInfoReference struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# KeyInfoReference"`
URI string `xml:",attr"`
Id string `xml:",attr,omitempty"`
}
NamedCurve struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# NamedCurve"`
URI string `xml:",attr"`
}
PnB struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# PnB"`
M uint
K1 uint
K2 uint
K3 uint
}
Prime struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# Prime"`
P string // represents the field size in bits. It is encoded as a positiveInteger.
}
TnB struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# TnB"`
M uint
K uint
}
ValidationData struct {
XMLName xml.Name `xml:"http://www.w3.org/2009/xmldsig11# ValidationData"`
HashAlgorithm string `xml:"hashAlgorithm,attr"`
Seed string
}
)