public class GnuRSAPrivateKey extends GnuRSAKey implements java.security.PrivateKey, java.security.interfaces.RSAPrivateCrtKey
An object that embodies an RSA private key.
References:
| Constructor and Description |
|---|
GnuRSAPrivateKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger e,
java.math.BigInteger d)
Trivial constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Returns
true if the designated object is an instance of
this class and has the same RSA parameter values as this one. |
java.math.BigInteger |
getCrtCoefficient() |
byte[] |
getEncoded(int format)
Returns the encoded form of this private key according to the
designated format.
|
java.math.BigInteger |
getPrimeExponentP() |
java.math.BigInteger |
getPrimeExponentQ() |
java.math.BigInteger |
getPrimeP() |
java.math.BigInteger |
getPrimeQ() |
java.math.BigInteger |
getPrivateExponent() |
static GnuRSAPrivateKey |
valueOf(byte[] k)
A class method that takes the output of the
encodePrivateKey()
method of an RSA keypair codec object (an instance implementing
IKeyPairCodec for RSA keys, and re-constructs an
instance of this object. |
getAlgorithm, getE, getEncoded, getFormat, getModulus, getN, getPublicExponentpublic GnuRSAPrivateKey(java.math.BigInteger p,
java.math.BigInteger q,
java.math.BigInteger e,
java.math.BigInteger d)
Trivial constructor.
p - the modulus first prime divisor.q - the modulus second prime divisor.e - the public exponent.d - the private exponent.public static GnuRSAPrivateKey valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey()
method of an RSA keypair codec object (an instance implementing
IKeyPairCodec for RSA keys, and re-constructs an
instance of this object.
k - the contents of a previously encoded instance of this object.java.lang.ArrayIndexOutOfBoundsException - if there is not enough bytes, in
k, to represent a valid encoding of an instance of this object.java.lang.IllegalArgumentException - if the byte sequence does not represent a
valid encoding of an instance of this object.public java.math.BigInteger getPrimeP()
getPrimeP in interface java.security.interfaces.RSAPrivateCrtKeypublic java.math.BigInteger getPrimeQ()
getPrimeQ in interface java.security.interfaces.RSAPrivateCrtKeypublic java.math.BigInteger getPrimeExponentP()
getPrimeExponentP in interface java.security.interfaces.RSAPrivateCrtKeypublic java.math.BigInteger getPrimeExponentQ()
getPrimeExponentQ in interface java.security.interfaces.RSAPrivateCrtKeypublic java.math.BigInteger getCrtCoefficient()
getCrtCoefficient in interface java.security.interfaces.RSAPrivateCrtKeypublic java.math.BigInteger getPrivateExponent()
getPrivateExponent in interface java.security.interfaces.RSAPrivateKeypublic byte[] getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
getEncoded in class GnuRSAKeyformat - the desired format identifier of the resulting encoding.java.lang.IllegalArgumentException - if the format is not supported.RSAKeyPairRawCodecpublic boolean equals(java.lang.Object obj)
Returns true if the designated object is an instance of
this class and has the same RSA parameter values as this one.
Copyright © 2025. All rights reserved.