|
Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10696-04 |
||||||||
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 FormField Summary |
---|
Fields inherited from interface java.security.Key |
---|
serialVersionUID |
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()
Key
getAlgorithm
in interface java.security.Key
public int getBitLength()
0 will be returned if the key has not been initialized.
public void erase()
protected void assertAllowExport()
false
, this method throws a KeyExportException
.FIPS_140_2.getAllowKeyExport()
public abstract java.lang.Object clone()
RSAKey
object.clone
in class java.lang.Object
public void setBytes(byte[] key) throws java.io.IOException
java.io.IOException
public int modulusLength()
public java.math.BigInteger getModulus()
getModulus
in interface java.security.interfaces.RSAKey
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.Externalizable
os
- 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.Externalizable
is
- The stream to read from.java.io.IOException
java.lang.ClassNotFoundException
|
Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10696-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |