Commit 2e38ffc5 authored by Sietse Ringers's avatar Sietse Ringers

refactor: remove superfluous helper

parent 46b482b0
......@@ -64,11 +64,14 @@ func StartRevocationServer(t *testing.T) {
revocationServer, err = irmaserver.New(conf)
require.NoError(t, err)
sk, err := conf.IrmaConfiguration.RevocationStorage.PrivateKey(cred.IssuerIdentifier())
sk, err := conf.PrivateKey(cred.IssuerIdentifier())
require.NoError(t, err)
require.NotNil(t, sk)
revsk, err := sk.RevocationKey()
require.NoError(t, err)
db, err := conf.IrmaConfiguration.RevocationStorage.DB(cred)
require.NoError(t, err)
err = db.EnableRevocation(sk)
err = db.EnableRevocation(revsk)
require.NoError(t, err)
mux := http.NewServeMux()
......
......@@ -314,21 +314,6 @@ func (rs *RevocationStorage) loadDB(credid CredentialTypeIdentifier) (*DB, error
return db, nil
}
func (rs *RevocationStorage) PrivateKey(issid IssuerIdentifier) (*revocation.PrivateKey, error) {
pk, err := rs.conf.PrivateKey(issid)
if err != nil {
return nil, err
}
if pk == nil {
return nil, errors.Errorf("unknown public key: %s", issid)
}
revpk, err := pk.RevocationKey()
if err != nil {
return nil, err
}
return revpk, nil
}
func (rs *RevocationStorage) PublicKey(issid IssuerIdentifier, counter uint) (*revocation.PublicKey, error) {
pk, err := rs.conf.PublicKey(issid, int(counter))
if err != nil {
......@@ -506,14 +491,6 @@ func (rs *RevocationStorage) Close() error {
func (rs *RevocationStorage) keystore(issuerid IssuerIdentifier) keystore {
return func(counter uint) (*revocation.PublicKey, error) {
key, err := rs.conf.PublicKey(issuerid, int(counter))
if err != nil {
return nil, err
}
revkey, err := key.RevocationKey()
if err != nil {
return nil, err
}
return revkey, nil
return rs.PublicKey(issuerid, counter)
}
}
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