| 
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
  
oracle.security.crypto.core.RSAKey
public abstract class RSAKey
An abstract class for RSA keys. Input and output is done using ASN.1 DER format.
RSAPrivateKey, RSAPublicKey, Serialized Form| Constructor Summary | |
|---|---|
protected | 
RSAKey()Empty constructor.  | 
protected | 
RSAKey(ASN1Sequence s)Creates an RSAKey from the specified ASN1Sequence.  | 
protected | 
RSAKey(java.math.BigInteger mod, java.math.BigInteger exp)Creates an RSAKey from the specified BigInteger objects.  | 
protected | 
RSAKey(byte[] key)Creates an RSAKey from the encoded representation.  | 
protected | 
RSAKey(java.io.InputStream is)Creates an RSAKey from the specified stream.  | 
| Method Summary | |
|---|---|
protected  void | 
assertAllowExport()If either this key's export flag or the global export flag is set to false, this method throws a KeyExportException. | 
abstract  java.lang.Object | 
clone()Creates a deep clone of this RSAKey object. | 
 void | 
erase()Erases the data stored in the key.  | 
 java.lang.String | 
getAlgorithm()Returns the algorithm for which this key is primarily used.  | 
 int | 
getBitLength()Returns the number of bits needed to represent the RSAKey's modulus.  | 
 java.math.BigInteger | 
getExponent()Returns the public exponent in this key is an RSAPublicKey, or the private exponent if this key is an RSAPrivateKey.  | 
 java.math.BigInteger | 
getModulus()Returns the modulus of this RSAKey.  | 
abstract  boolean | 
isPublic()Returns true if this is a public key, false if it's a private key. | 
 int | 
modulusLength()The length of the modulus in bytes.  | 
 void | 
readExternal(java.io.ObjectInput is)Reads the input stream and initializes the RSA key.  | 
 void | 
setBytes(byte[] key)Set bytes of the key.  | 
 void | 
setModulusExponent(java.math.BigInteger mod, java.math.BigInteger exp)Sets the modulus and the exponent.  | 
 void | 
writeExternal(java.io.ObjectOutput os)Writes to the output stream the DER encoding of this object.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface oracle.security.crypto.core.Key | 
|---|
getAllowExport, getEncoded, getFormat | 
| Methods inherited from interface oracle.security.crypto.util.Streamable | 
|---|
input, length, output | 
| Constructor Detail | 
|---|
protected RSAKey()
protected RSAKey(byte[] key)
          throws java.io.IOException
key - The encoded representation of the key.java.io.IOException
protected RSAKey(java.io.InputStream is)
          throws java.io.IOException
java.io.IOException
protected RSAKey(ASN1Sequence s)
          throws java.io.IOException
java.io.IOException
protected RSAKey(java.math.BigInteger mod,
                 java.math.BigInteger exp)
mod - The modulus.exp - The public exponent in the case of a public key, the private exponent in case of a private key.| Method Detail | 
|---|
public java.lang.String getAlgorithm()
KeygetAlgorithm in interface Keypublic int getBitLength()
0 will be returned if the key has not been initialized.
getBitLength in interface Keypublic void erase()
erase in interface Keyprotected void assertAllowExport()
false, this method throws a KeyExportException.FIPS_140_2.getAllowKeyExport()public abstract java.lang.Object clone()
RSAKey object.clone in interface Keyclone in class java.lang.Object
public void setBytes(byte[] key)
              throws java.io.IOException
java.io.IOExceptionpublic int modulusLength()
public java.math.BigInteger getModulus()
public java.math.BigInteger getExponent()
public void setModulusExponent(java.math.BigInteger mod,
                               java.math.BigInteger exp)
mod - The modulus.exp - The public exponent if this key is a public key, or the private exponent if this key is a private key.public abstract boolean isPublic()
true if this is a public key, false if it's a private key.
public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
writeExternal in interface java.io.Externalizableos - The output stream to write the encoding to.java.io.IOException
public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizableis - The stream to read from.java.io.IOExceptionjava.lang.ClassNotFoundException
  | 
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||