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
072251ce
Commit
072251ce
authored
Jun 04, 2017
by
Sietse Ringers
Browse files
Also parse keys
parent
99641cc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
store.go
View file @
072251ce
...
...
@@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"github.com/mhe/gabi"
)
...
...
@@ -50,12 +51,30 @@ func (store *ConfigurationStore) parseIssuerFolders(path string) error {
}
if
exists
{
store
.
issuers
[
issuer
.
Identifier
()
.
string
]
=
issuer
return
store
.
parseCredentialsFolder
(
dir
+
"/Issues/"
)
if
err
=
store
.
parseCredentialsFolder
(
dir
+
"/Issues/"
);
err
!=
nil
{
return
err
}
return
store
.
parseKeysFolder
(
issuer
.
Identifier
(),
dir
+
"/PublicKeys/"
)
}
return
nil
})
}
func
(
store
*
ConfigurationStore
)
parseKeysFolder
(
issuer
*
IssuerIdentifier
,
path
string
)
error
{
for
i
:=
0
;
;
i
++
{
file
:=
path
+
strconv
.
Itoa
(
i
)
+
".xml"
if
_
,
err
:=
os
.
Stat
(
file
);
err
!=
nil
{
break
}
pk
,
err
:=
gabi
.
NewPublicKeyFromFile
(
file
)
if
err
!=
nil
{
return
err
}
MetaStore
.
publickeys
[
issuer
.
string
]
=
pk
}
return
nil
}
func
(
store
*
ConfigurationStore
)
parseCredentialsFolder
(
path
string
)
error
{
return
iterateSubfolders
(
path
,
func
(
dir
string
)
error
{
cred
:=
&
CredentialDescription
{}
...
...
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