Commit e485a7a9 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Support downloading default schemes (pbdf and irma-demo)

parent 4a089d54
package irma
type SchemeManagerPointer struct {
Url string
Publickey []byte
}
var DefaultSchemeManagers = [2]SchemeManagerPointer{
{
Url: "https://privacybydesign.foundation/schememanager/irma-demo",
Publickey: []byte(`-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHVnmAY+kGkFZn7XXozdI4HY8GOjm
54ngh4chTfn6WsTCf2w5rprfIqML61z2VTE4k8yJ0Z1QbyW6cdaao8obTQ==
-----END PUBLIC KEY-----`),
},
{
Url: "https://privacybydesign.foundation/schememanager/pbdf",
Publickey: []byte(`-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELzHV5ipBimWpuZIDaQQd+KmNpNop
dpBeCqpDwf+Grrw9ReODb6nwlsPJ/c/gqLnc+Y3sKOAJ2bFGI+jHBSsglg==
-----END PUBLIC KEY-----`),
},
}
func (conf *Configuration) DownloadDefaultSchemes() error {
for _, s := range DefaultSchemeManagers {
scheme, err := DownloadSchemeManager(s.Url)
if err != nil {
return err
}
if err := conf.InstallSchemeManager(scheme, s.Publickey); err != nil {
return err
}
}
return nil
}
Supports Markdown
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