Commit 112f7e8f authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Use default AttributeList marshaling

parent bcad7f09
......@@ -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{
......
......@@ -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)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment