Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
112f7e8f
Commit
112f7e8f
authored
Sep 30, 2017
by
Sietse Ringers
Browse files
Use default AttributeList marshaling
parent
bcad7f09
Changes
2
Hide whitespace changes
Inline
Side-by-side
attributes.go
View file @
112f7e8f
...
...
@@ -51,20 +51,6 @@ type AttributeList struct {
info
*
CredentialInfo
}
func
(
al
*
AttributeList
)
MarshalJSON
()
([]
byte
,
error
)
{
return
json
.
Marshal
(
al
.
Ints
)
}
func
(
al
*
AttributeList
)
UnmarshalJSON
(
bytes
[]
byte
)
error
{
ints
:=
[]
*
big
.
Int
{}
if
err
:=
json
.
Unmarshal
(
bytes
,
&
ints
);
err
!=
nil
{
return
err
}
list
:=
NewAttributeListFromInts
(
ints
,
nil
)
*
al
=
*
list
return
nil
}
// NewAttributeListFromInts initializes a new AttributeList from a list of bigints.
func
NewAttributeListFromInts
(
ints
[]
*
big
.
Int
,
store
*
ConfigurationStore
)
*
AttributeList
{
return
&
AttributeList
{
...
...
storage.go
View file @
112f7e8f
...
...
@@ -26,6 +26,12 @@ const (
cardemuXML
=
"../cardemu.xml"
)
type
update
struct
{
when
Timestamp
number
int
info
string
}
// PathExists checks if the specified path exists.
func
PathExists
(
path
string
)
(
bool
,
error
)
{
_
,
err
:=
os
.
Stat
(
path
)
...
...
@@ -273,7 +279,7 @@ func (cm *CredentialManager) loadAttributes() (list map[CredentialTypeIdentifier
for
_
,
attrlistlist
:=
range
list
{
for
_
,
attrlist
:=
range
attrlistlist
{
attrlist
.
MetadataAttribute
.
store
=
cm
.
Store
attrlist
.
MetadataAttribute
=
MetadataFromInt
(
attrlist
.
Ints
[
0
],
cm
.
Store
)
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment