Package com.unboundid.util.ssl.cert
Class RSAPrivateKey
java.lang.Object
com.unboundid.util.ssl.cert.DecodedPrivateKey
com.unboundid.util.ssl.cert.RSAPrivateKey
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class RSAPrivateKey
extends DecodedPrivateKey
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 Summary
Modifier and TypeMethodDescriptionRetrieves the coefficient for the RSA private key.Retrieves the exponent1 value for the RSA private key.Retrieves the exponent2 value for the RSA private key.Retrieves the modulus (n) for the RSA private key.List<BigInteger[]> Retrieves a list of information about other primes used by the private key.Retrieves the prime1 (p) value for the RSA private key.Retrieves the prime2 (q) value for the RSA private key.Retrieves the private exponent (d) for the RSA private key.Retrieves the public exponent (e) for the RSA public key.Retrieves the version for the RSA private key.voidtoString(StringBuilder buffer) Appends a string representation of this decoded private key to the provided buffer.Methods inherited from class com.unboundid.util.ssl.cert.DecodedPrivateKey
toString
-
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 threeBigIntegervalues, which represent a prime, an exponent, and a coefficient, respectively.- Returns:
- A list of information about other primes used by the private key.
-
toString
Appends a string representation of this decoded private key to the provided buffer.- Specified by:
toStringin classDecodedPrivateKey- Parameters:
buffer- The buffer to which the information should be appended.
-