Class RSAPrivateKey

java.lang.Object
com.unboundid.util.ssl.cert.DecodedPrivateKey
com.unboundid.util.ssl.cert.RSAPrivateKey
All Implemented Interfaces:
Serializable

This class provides a data structure for representing the information contained in an RSA private key. As per RFC 8017 section A.1.2, an RSA private key is identified by OID 1.2.840.113549.1.1.1 and the value is encoded as follows:
   RSAPrivateKey ::= SEQUENCE {
       version           Version,
       modulus           INTEGER,  -- n
       publicExponent    INTEGER,  -- e
       privateExponent   INTEGER,  -- d
       prime1            INTEGER,  -- p
       prime2            INTEGER,  -- q
       exponent1         INTEGER,  -- d mod (p-1)
       exponent2         INTEGER,  -- d mod (q-1)
       coefficient       INTEGER,  -- (inverse of q) mod p
       otherPrimeInfos   OtherPrimeInfos OPTIONAL
   }

   OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo

   OtherPrimeInfo ::= SEQUENCE {
       prime             INTEGER,  -- ri
       exponent          INTEGER,  -- di
       coefficient       INTEGER   -- ti
   }
 
See Also:
  • Method Details

    • getVersion

      Retrieves the version for the RSA private key.
      Returns:
      The version for the RSA private key.
    • getModulus

      Retrieves the modulus (n) for the RSA private key.
      Returns:
      The modulus for the RSA private key.
    • getPublicExponent

      Retrieves the public exponent (e) for the RSA public key.
      Returns:
      The public exponent for the RSA public key.
    • getPrivateExponent

      Retrieves the private exponent (d) for the RSA private key.
      Returns:
      The private exponent for the RSA private key.
    • getPrime1

      Retrieves the prime1 (p) value for the RSA private key.
      Returns:
      The prime1 value for the RSA private key.
    • getPrime2

      Retrieves the prime2 (q) value for the RSA private key.
      Returns:
      The prime2 value for the RSA private key.
    • getExponent1

      Retrieves the exponent1 value for the RSA private key.
      Returns:
      The exponent1 value for the RSA private key.
    • getExponent2

      Retrieves the exponent2 value for the RSA private key.
      Returns:
      The exponent2 value for the RSA private key.
    • getCoefficient

      Retrieves the coefficient for the RSA private key.
      Returns:
      The coefficient for the RSA private key.
    • getOtherPrimeInfos

      Retrieves a list of information about other primes used by the private key. If the list is non-empty, then each item will be an array of three BigInteger values, which represent a prime, an exponent, and a coefficient, respectively.
      Returns:
      A list of information about other primes used by the private key.
    • toString

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of this decoded private key to the provided buffer.
      Specified by:
      toString in class DecodedPrivateKey
      Parameters:
      buffer - The buffer to which the information should be appended.