restructuring + tidying

This commit is contained in:
tsmethurst 2021-04-27 18:50:02 +02:00
commit f5dde82363
72 changed files with 299 additions and 370 deletions

View file

@ -41,7 +41,7 @@ type controller struct {
}
// NewController returns an implementation of the Controller interface for creating new transports
func NewController(config *config.Config,clock pub.Clock, client pub.HttpClient, log *logrus.Logger) Controller {
func NewController(config *config.Config, clock pub.Clock, client pub.HttpClient, log *logrus.Logger) Controller {
return &controller{
config: config,
clock: clock,
@ -50,6 +50,7 @@ func NewController(config *config.Config,clock pub.Clock, client pub.HttpClient,
}
}
// NewTransport returns a new http signature transport with the given public key id (a URL), and the given private key.
func (c *controller) NewTransport(pubKeyID string, privkey crypto.PrivateKey) (pub.Transport, error) {
prefs := []httpsig.Algorithm{httpsig.RSA_SHA256, httpsig.RSA_SHA512}
digestAlgo := httpsig.DigestSha256