title: PS256 algorithm support for signatures in Java
body: <p>According to the Java 12 security specs <a href="https://docs.oracle.com/en/java/javase/12/docs/specs/security/standard-names.html#signature-algorithms" rel="nofollow noreferrer">here</a> the RSASSA-PSS signature scheme should be supported (actually as of Java 11).
  However, if I try to use a signature with PS256 algorithm in my JWT using e.g. the <a href="https://connect2id.com/products/nimbus-jose-jwt" rel="nofollow noreferrer">nimbus jose+jwt</a> library, then it doesn't work unless I use BouncyCastle.</p>
  
  <pre><code>        val signer = RSASSASigner(signKey)
          val jwsObject = JWSObject(
                  JWSHeader.Builder(JWSAlgorithm.PS256)    // PS256 gives error;  RS256 will work
                          .keyID(signKeyId)
                          .build(),
                  Payload(json)
          jwsObject.sign(signer)
  </code></pre>
  
  <p>This gives an error:</p>
  
  <pre><code>java.security.NoSuchAlgorithmException: SHA256withRSAandMGF1 Signature not available
  </code></pre>
  
  <p>And indeed <code>JCASupport.isSupported(JWSAlgorithm.PS256)</code> is false</p>
  
  <p>If I include BouncyCastle then it does work:</p>
  
  <pre><code>        Security.addProvider(BouncyCastleProviderSingleton.getInstance())
          JCASupport.isSupported(JWSAlgorithm.PS256) == true
  </code></pre>
  
  <p>I would have thought that BouncyCastle is not necessary anymore in Java 12 (I'm actually using Kotlin 1.3 with Java 12 and Spring Boot 2.2 and com.nimbusds 8.4 to be precise). 
  I would like to be independent from BouncyCastle.</p>
  
  <p>What am I missing?</p>