@@ -27,19 +27,19 @@ import (
27
27
// NewSigner creates a new [crypto.Signer] for the given key-pair.
28
28
//
29
29
// NewSigner cannot be used with symetric keys.
30
- func (client * Client ) NewSigner (ctx context.Context , serviceKeyID uuid.UUID , format * types. SignatureFormats ) (crypto.Signer , error ) {
30
+ func (client * Client ) NewSigner (ctx context.Context , serviceKeyID uuid.UUID ) (crypto.Signer , error ) {
31
31
k , err := client .ExportJwkPublicKey (ctx , serviceKeyID )
32
32
if err != nil {
33
33
return nil , err
34
34
}
35
- return newSigner (client , k , format )
35
+ return newSigner (client , k )
36
36
}
37
37
38
38
// newSigner creates a new [crypto.Signer] using the given public JsonWebKey and
39
39
// its remote private key.
40
40
//
41
41
// newSigner cannot be used with symetric keys.
42
- func newSigner (api SignatureApi , jwk * types.JsonWebKeyResponse , format * types. SignatureFormats ) (crypto.Signer , error ) {
42
+ func newSigner (api SignatureApi , jwk * types.JsonWebKeyResponse ) (crypto.Signer , error ) {
43
43
pubKey , err := jwk .PublicKey ()
44
44
if err != nil {
45
45
return nil , err
@@ -49,15 +49,13 @@ func newSigner(api SignatureApi, jwk *types.JsonWebKeyResponse, format *types.Si
49
49
JsonWebKeyResponse : jwk ,
50
50
api : api ,
51
51
pubKey : pubKey ,
52
- format : format ,
53
52
}, nil
54
53
}
55
54
56
55
type jwkSigner struct {
57
56
* types.JsonWebKeyResponse
58
57
api SignatureApi
59
58
pubKey crypto.PublicKey
60
- format * types.SignatureFormats
61
59
}
62
60
63
61
// Public returns the public key corresponding to the opaque,
@@ -130,12 +128,8 @@ func (sign *jwkSigner) doSign(digest []byte, hash crypto.Hash, algPrefix string)
130
128
if err != nil {
131
129
return nil , fmt .Errorf ("Key ID %q is not a valid UUID" , sign .Kid )
132
130
}
133
- format := sign .format
134
- if format == nil {
135
- rawFormat := types .Raw
136
- format = & rawFormat
137
- }
138
- resp , err := sign .api .Sign (context .Background (), keyId , format , alg , true , digest )
131
+ rawFormat := types .Raw
132
+ resp , err := sign .api .Sign (context .Background (), keyId , & rawFormat , alg , true , digest )
139
133
if err != nil {
140
134
return nil , err
141
135
}
0 commit comments