Class RsaJWK


public class RsaJWK extends JWK
Implements a RsaJWK.
  • Constructor Details

    • RsaJWK

      public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      n - the modulus of the JWK
      e - the public exponent JWK
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String d, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      n - the modulus of the JWK
      e - the public exponent JWK
      d - the private exponent JWK
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String p, String q, String dp, String dq, String qi, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      n - the modulus of the JWK
      e - the public exponent JWK
      p - the first prime factor of the JWK
      q - the second prime factor of the JWK
      dp - the first factor exponent of the JWK
      dq - the second factor exponent of the JWK
      qi - the first CRT Coefficient of the JWK
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(KeyUse use, String alg, String kid, String n, String e, String d, String p, String q, String dp, String dq, String qi, List<RsaJWK.OtherFactors> factors, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      n - the modulus of the JWK
      e - the public exponent JWK
      d - the private exponent JWK
      p - the first prime factor of the JWK
      q - the second prime factor of the JWK
      dp - the first factor exponent of the JWK
      dq - the second factor exponent of the JWK
      qi - the first CRT Coefficient of the JWK
      factors - the extra factors of the JWK
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(RSAPublicKey key, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      key - the RSAPublicKey to use
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(RSAPublicKey pubKey, RSAPrivateKey privKey, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      pubKey - the RSAPublicKey to use
      privKey - the RSAPrivateKey to use
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
    • RsaJWK

      public RsaJWK(RSAPublicKey pubKey, RSAPrivateCrtKey privCert, KeyUse use, String alg, String kid, String x5u, String x5t, List<String> x5c)
      Creates a RsaJWK.
      Parameters:
      use - the use of the JWK
      alg - the alg of the JWK
      kid - the key id of the JWK
      pubKey - the RSAPublicKey to use
      privCert - the RSAPrivateCrtKey to use
      x5u - the x509 url for the key
      x5t - the x509 thumbnail for the key
      x5c - the x509 chain as a list of Base64 encoded strings
  • Method Details

    • getModulus

      public String getModulus()
      Get the RSA modulus value.
      Returns:
      a Base64url modulus value
    • getPublicExponent

      Get the RSA Public Exponent.
      Returns:
      a Base64url Public Exponent value
    • getPrivateExponent

      Get the RSA Private Exponent value.
      Returns:
      a Base64url Private Exponent value
    • getPrimeP

      public String getPrimeP()
      Get the RSA First Prime Factor value.
      Returns:
      a Base64url First Prime Factor value
    • getPrimeQ

      public String getPrimeQ()
      Get the RSA Second Prime Factor value.
      Returns:
      a Base64url Second Prime Factor value
    • getPrimePExponent

      Get the RSA First Factor CRT Exponent value.
      Returns:
      a Base64url First Factor CRT Exponent value
    • getPrimeQExponent

      Get the RSA Second factor CRT Exponent value.
      Returns:
      a Base64url Second factor CRT Exponent value
    • getCRTCoefficient

      Get the RSA First CRT Coefficient value.
      Returns:
      a Base64url First CRT Coefficient value
    • getOtherFactors

      Get the RSA other factors value.
      Returns:
      a Base64url other factors value
    • toRSAPublicKey

      Creates a RSAPublicKey from the JWK.
      Returns:
      a RSAPublicKey
    • toRSAPrivateKey

      Creates a RSAPrivateKey from the JWK.
      Returns:
      a RSAPrivateKey
    • toKeyPair

      public KeyPair toKeyPair()
      Create a KeyPair using the JWK.
      Returns:
      a KeyPair
    • parse

      public static RsaJWK parse(String json)
      Parses a RsaJWK from a json string.
      Parameters:
      json - a string json object
      Returns:
      a RsaJWK
    • parse

      public static RsaJWK parse(JsonValue json)
      Parses a RsaJWK from a jsonValue Object.
      Parameters:
      json - a jsonValue object
      Returns:
      a RsaJWK
    • toJsonString

      public String toJsonString()
      Prints the RsaJWK object as a json string.
      Overrides:
      toJsonString in class JWK
      Returns:
      json string