Add comment about PSSOptions to jws.go.

This commit is contained in:
Jacob Hoffman-Andrews 2015-03-25 18:56:00 -07:00
parent c7c5617b6c
commit 6e48708a74
1 changed files with 2 additions and 0 deletions

View File

@ -190,6 +190,8 @@ func Sign(alg JoseAlgorithm, privateKey interface{}, payload []byte) (JsonWebSig
if rsaPriv == nil {
return zero, errors.New(fmt.Sprintf("Algorithm %s requres RSA private key", jws.Header.Algorithm))
}
// Contrary to docs, you can't pass a nil instead of the PSSOptions; You'll
// get a nil dereference.
sig, err = rsa.SignPSS(rand.Reader, rsaPriv, hashID, inputHash, &rsa.PSSOptions{})
case "E":
if ecPriv == nil {