All Superinterfaces:
AsymmetricJWK<RSAPublicKey,RSAPrivateKey>, JWK, X509JWK<RSAPublicKey,RSAPrivateKey>

public interface RSAJWK extends X509JWK<RSAPublicKey,RSAPrivateKey>

RSA JSON Web Key.

An RSA JWK is asymmetric. The public key is composed of the modulus and the public exponent. The private key is defined by the private exponent. Other parameters can be present when the key is a multi prime key.

Since:
1.5
Author:
Jeremy Kuhn
  • Field Details

  • Method Details

    • getModulus

      String getModulus()

      Returns the modulus encoded as Base64URL.

      Returns:
      the Base64URL encoded modulus with no padding.
    • getPublicExponent

      String getPublicExponent()

      Returns the public exponent encoded as Base64URL.

      Returns:
      the Base64URL encoded public exponent with no padding.
    • getPrivateExponent

      String getPrivateExponent()

      Returns the private exponent encoded as Base64URL.

      Returns:
      the Base64URL encoded private exponent with no padding.
    • getFirstPrimeFactor

      String getFirstPrimeFactor()

      Returns the first prime factor encoded as Base64URL.

      Returns:
      the Base64URL encoded first prime factor with no padding.
    • getSecondPrimeFactor

      String getSecondPrimeFactor()

      Returns the second prime factor encoded as Base64URL.

      Returns:
      the Base64URL encoded second prime factor with no padding.
    • getFirstFactorExponent

      String getFirstFactorExponent()

      Returns the first factor exponent encoded as Base64URL.

      Returns:
      the Base64URL encoded first factor exponent with no padding.
    • getSecondFactorExponent

      String getSecondFactorExponent()

      Returns the second factor exponent encoded as Base64URL.

      Returns:
      the Base64URL encoded second factor exponent with no padding.
    • getFirstCoefficient

      String getFirstCoefficient()

      Returns the first coefficient encoded as Base64URL.

      Returns:
      the Base64URL encoded first coefficient with no padding.
    • getOtherPrimesInfo

      List<RSAJWK.OtherPrimeInfo> getOtherPrimesInfo()

      Returns the list of other primes info.

      Returns:
      the list of other primes info or null
    • toPublicJWK

      RSAJWK toPublicJWK()
      Description copied from interface: JWK

      Returns a public and safe to share representation of the key.

      Specified by:
      toPublicJWK in interface AsymmetricJWK<RSAPublicKey,RSAPrivateKey>
      Specified by:
      toPublicJWK in interface JWK
      Specified by:
      toPublicJWK in interface X509JWK<RSAPublicKey,RSAPrivateKey>
      Returns:
      a public representation of this JWK
    • minify

      RSAJWK minify()
      Description copied from interface: JWK

      Returns a minified representation of the key only containing required data.

      Note that the returned JWK may contain private data.

      Specified by:
      minify in interface JWK
      Returns:
      a minified representation of this JWK
    • trust

      RSAJWK trust()
      Description copied from interface: JWK

      Trusts the key explicitly.

      This should be used with care when the authenticity of an untrusted key has been established through external means.

      Specified by:
      trust in interface AsymmetricJWK<RSAPublicKey,RSAPrivateKey>
      Specified by:
      trust in interface JWK
      Specified by:
      trust in interface X509JWK<RSAPublicKey,RSAPrivateKey>
      Returns:
      this JWK