Class au.net.aba.crypto.provider.RSAPublicKey
All Packages Class Hierarchy This Package Previous Next Index
Class au.net.aba.crypto.provider.RSAPublicKey
java.lang.Object
|
+----au.net.aba.crypto.provider.RSAPublicKey
- public class RSAPublicKey
- extends Object
- implements Key, PublicKey
A class for ABA RSA public keys.
-
exponent
- The exponent component of the two part key that is
required by the RSA algorithm.
-
ident
-
-
modulus
- The modulus component of the two part key that is
required by the RSA algorithm.
-
RSAPublicKey()
- Construct an empty RSAPublicKey.
-
RSAPublicKey(BigInteger, BigInteger)
- Construct an RSAPublicKey from two integral components.
-
RSAPublicKey(KeySpec)
-
-
decrypt(BigInteger)
- Decrypt a data block with this key.
-
encrypt(BigInteger)
- Encrypt a data block with this key.
-
getAlgorithm()
- return the algorithm for this key.
-
getEncoded()
- Return an encoded representation for this key.
-
getFormat()
- return the format this key is in.
-
setFields(BigInteger, BigInteger)
- This should have been the constructor above, but as we can't
chain constructors other than as the first call (and we
can't do that at line 105), we're reduced to this.
-
significantBytes()
- Determine the number of significant bytes in the key.
-
toString()
- Generate a String representation of this key.
ident
public final static String ident
exponent
protected BigInteger exponent
- The exponent component of the two part key that is
required by the RSA algorithm.
modulus
protected BigInteger modulus
- The modulus component of the two part key that is
required by the RSA algorithm.
RSAPublicKey
public RSAPublicKey()
- Construct an empty RSAPublicKey.
RSAPublicKey
public RSAPublicKey(KeySpec keySpec)
RSAPublicKey
public RSAPublicKey(BigInteger modulus,
BigInteger exponent)
- Construct an RSAPublicKey from two integral components.
- Parameters:
- modulus - The modulus value.
- exponent - The exponent value.
setFields
protected void setFields(BigInteger modulus,
BigInteger exponent)
- This should have been the constructor above, but as we can't
chain constructors other than as the first call (and we
can't do that at line 105), we're reduced to this.
- Parameters:
- modulus - The modulus value.
- exponent - The exponent value.
getAlgorithm
public String getAlgorithm()
- return the algorithm for this key.
getFormat
public String getFormat()
- return the format this key is in.
getEncoded
public byte[] getEncoded()
- Return an encoded representation for this key. Returns a byte
array containing the string as a dotted hex string.
- See Also:
- toString
significantBytes
public int significantBytes()
- Determine the number of significant bytes in the key.
Note: this assumes our keys will always be positive numbers.
- Returns:
- The number of bytes.
toString
public String toString()
- Generate a String representation of this key.
- Returns:
- The key as a string.
- Overrides:
- toString in class Object
encrypt
protected BigInteger encrypt(BigInteger plainText)
- Encrypt a data block with this key.
- Parameters:
- plainText - The plain text block to encrypt.
- Returns:
- The encrypted data.
decrypt
protected BigInteger decrypt(BigInteger cipherText)
- Decrypt a data block with this key.
- Parameters:
- data - The cipher text block to decrypt.
- Returns:
- The decrypted data.
All Packages Class Hierarchy This Package Previous Next Index