Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


oracle.security.crypto.core
Class RSAKey

java.lang.Object
  extended byoracle.security.crypto.core.RSAKey

All Implemented Interfaces:
ASN1Object, java.lang.Cloneable, Key, Streamable
Direct Known Subclasses:
RSAPrivateKey, RSAPublicKey

public abstract class RSAKey
extends java.lang.Object
implements Key, ASN1Object

An abstract class for RSA keys. Input and output is done using ASN.1 DER format.

See Also:
RSAPrivateKey, RSAPublicKey

Constructor Summary
protected RSAKey()
           
protected RSAKey(ASN1Sequence s)
           
protected RSAKey(java.math.BigInteger mod, java.math.BigInteger exp)
           
protected RSAKey(byte[] key)
           
protected RSAKey(java.io.InputStream is)
           

 

Method Summary
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.
 byte[] getEncoded()
          Returns the encoded form of this key.
 java.math.BigInteger getExponent()
           
 java.math.BigInteger getModulus()
           
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 setBytes(byte[] key)
          Set bytes of the key.
 void setModulusExponent(java.math.BigInteger mod, java.math.BigInteger exp)
           

 

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
getFormat

 

Methods inherited from interface oracle.security.crypto.util.Streamable
input, length, output

 

Constructor Detail

RSAKey

protected RSAKey()

RSAKey

protected RSAKey(byte[] key)
          throws java.io.IOException

RSAKey

protected RSAKey(java.io.InputStream is)
          throws java.io.IOException

RSAKey

protected RSAKey(ASN1Sequence s)
          throws java.io.IOException

RSAKey

protected RSAKey(java.math.BigInteger mod,
                 java.math.BigInteger exp)

Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Description copied from interface: Key
Returns the algorithm for which this key is primarily used.
Specified by:
getAlgorithm in interface Key

setBytes

public void setBytes(byte[] key)
              throws java.io.IOException
Set bytes of the key.
Throws:
java.io.IOException

modulusLength

public int modulusLength()
The length of the modulus in bytes.

getModulus

public java.math.BigInteger getModulus()

getExponent

public java.math.BigInteger getExponent()

setModulusExponent

public void setModulusExponent(java.math.BigInteger mod,
                               java.math.BigInteger exp)

getEncoded

public byte[] getEncoded()
Description copied from interface: Key
Returns the encoded form of this key.
Specified by:
getEncoded in interface Key

getBitLength

public int getBitLength()
Returns the number of bits needed to represent the RSAKey's modulus.

0 will be returned if the key has not been initialized.

Specified by:
getBitLength in interface Key

isPublic

public abstract boolean isPublic()
Returns true if this is a public key, false if it's a private key.

clone

public abstract java.lang.Object clone()
Creates a deep clone of this RSAKey object.
Specified by:
clone in interface Key

erase

public void erase()
Erases the data stored in the key.
Specified by:
erase in interface Key

Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.