au.net.aba.crypto.provider
Class RSAPubKey

java.lang.Object
  |
  +--au.net.aba.crypto.provider.RSAPubKey

public class RSAPubKey
extends java.lang.Object
implements java.security.interfaces.RSAPublicKey

A class for ABA RSA public keys.

See Also:
Serialized Form

Field Summary
protected  java.math.BigInteger exponent
          The exponent component of the two part key that is required by the RSA algorithm.
static java.lang.String ident
           
protected  java.math.BigInteger modulus
          The modulus component of the two part key that is required by the RSA algorithm.
 
Constructor Summary
RSAPubKey()
          Construct an empty RSAPubKey.
RSAPubKey(java.math.BigInteger modulus, java.math.BigInteger exponent)
          Construct an RSAPubKey from two integral components.
RSAPubKey(byte[] encKey)
          Construct an RSAPubKey from an X.509 encoded byte array
 
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()
          Returns the modulus.
 java.math.BigInteger getPublicExponent()
          Returns the public 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
 

Field Detail

ident

public static final java.lang.String ident

exponent

protected java.math.BigInteger exponent
The exponent component of the two part key that is required by the RSA algorithm.

modulus

protected java.math.BigInteger modulus
The modulus component of the two part key that is required by the RSA algorithm.
Constructor Detail

RSAPubKey

public RSAPubKey()
Construct an empty RSAPubKey.

RSAPubKey

public RSAPubKey(java.math.BigInteger modulus,
                 java.math.BigInteger exponent)
Construct an RSAPubKey from two integral components.
Parameters:
modulus - The modulus value.
exponent - The exponent value.

RSAPubKey

public RSAPubKey(byte[] encKey)
Construct an RSAPubKey from an X.509 encoded byte array
Method Detail

getModulus

public java.math.BigInteger getModulus()
Returns the modulus.
Specified by:
getModulus in interface java.security.interfaces.RSAPublicKey
Returns:
the modulus

getPublicExponent

public java.math.BigInteger getPublicExponent()
Returns the public exponent.
Specified by:
getPublicExponent in interface java.security.interfaces.RSAPublicKey
Returns:
the public 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 "X.509".

getEncoded

public byte[] getEncoded()
Return an encoded representation for this key. Returns a DER encoded X.509 SubjectPublicKeyInfo block containing a RSAPublicKey as defined in PKCS#1.
See Also:
getFormat(), toString()

toString

public java.lang.String toString()
Generate a String representation of this key.
Returns:
The key as a string.
Overrides:
toString in class java.lang.Object