au.net.aba.crypto.provider
Class RSAPrivKey
java.lang.Object
|
+--au.net.aba.crypto.provider.RSAPrivKey
- Direct Known Subclasses:
- RSAPrivKeyCrt
- public class RSAPrivKey
- extends java.lang.Object
- implements java.security.interfaces.RSAPrivateKey
A class for ABA RSA private keys.
- See Also:
- Serialized Form
|
Field Summary |
protected java.math.BigInteger |
d
The private exponent of this key. |
static java.lang.String |
ident
|
protected java.math.BigInteger |
modulus
The modulus of this key. |
| Fields inherited from interface java.security.PrivateKey |
serialVersionUID |
| Fields inherited from interface java.security.Key |
serialVersionUID |
|
Constructor Summary |
RSAPrivKey()
Construct an empty RSAPrivKey. |
RSAPrivKey(java.math.BigInteger modulus,
java.math.BigInteger privateExponent)
|
|
Method Summary |
java.lang.String |
getAlgorithm()
Return the algorithm for this key. |
byte[] |
getEncoded()
Return an encoded representation for this key. |
java.lang.String |
getFormat()
Return the format this key is in. |
java.math.BigInteger |
getModulus()
Return the modulus. |
java.math.BigInteger |
getPrivateExponent()
Return the private exponent |
java.lang.String |
toString()
Generate a String representation of this key. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
ident
public static final java.lang.String ident
modulus
protected java.math.BigInteger modulus
- The modulus of this key.
d
protected java.math.BigInteger d
- The private exponent of this key.
RSAPrivKey
public RSAPrivKey()
- Construct an empty RSAPrivKey.
RSAPrivKey
public RSAPrivKey(java.math.BigInteger modulus,
java.math.BigInteger privateExponent)
getModulus
public java.math.BigInteger getModulus()
- Return the modulus.
- Specified by:
- getModulus in interface java.security.interfaces.RSAPrivateKey
- Returns:
- the modulus.
getPrivateExponent
public java.math.BigInteger getPrivateExponent()
- Return the private exponent
- Specified by:
- getPrivateExponent in interface java.security.interfaces.RSAPrivateKey
- Returns:
- the private exponent.
getAlgorithm
public java.lang.String getAlgorithm()
- Return the algorithm for this key.
- Returns:
- the string RSA.
getFormat
public java.lang.String getFormat()
- Return the format this key is in. This returns "ABA" which
indicates the encoded key is the form of a byte array whose
contents form the string "modulus.exponent" (ie the String
returned from the
toString() method. This
format is compatible with the AsciiEncodedKeySpec.
getEncoded
public byte[] getEncoded()
- Return an encoded representation for this key. Returns a
byte array that forms the string "modulus.exponent".
- See Also:
getFormat(),
toString()
toString
public java.lang.String toString()
- Generate a String representation of this key.
- Overrides:
- toString in class java.lang.Object
- Returns:
- The key as a string.