Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-03


oracle.security.crypto.core
Class KeyPair

java.lang.Object
  extended by oracle.security.crypto.core.KeyPair

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class KeyPair
extends java.lang.Object
implements java.io.Externalizable

This class encapsulates a key pair, consisting of a public key and a private key.

See Also:
Serialized Form

Constructor Summary
KeyPair()
          Creates a new empty instance.
KeyPair(PublicKey publicKey, PrivateKey privateKey)
          Creates a new key pair.

 

Method Summary
 PrivateKey getPrivate()
          Returns the private key.
 PublicKey getPublic()
          Returns the public key.
 void readExternal(java.io.ObjectInput is)
          Reads the input stream and initializes the key pair.
 void setPrivate(PrivateKey privateKey)
          Sets the private key.
 void setPublic(PublicKey publicKey)
          Sets the public key.
 void writeExternal(java.io.ObjectOutput os)
          Writes to the output stream the DER encoding of this object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

KeyPair

public KeyPair()
Creates a new empty instance. This constructor is to be used with serialization.

KeyPair

public KeyPair(PublicKey publicKey,
               PrivateKey privateKey)
Creates a new key pair.

Method Detail

getPublic

public PublicKey getPublic()
Returns the public key.

setPublic

public void setPublic(PublicKey publicKey)
Sets the public key.

getPrivate

public PrivateKey getPrivate()
Returns the private key.

setPrivate

public void setPrivate(PrivateKey privateKey)
Sets the private key.

writeExternal

public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
Writes to the output stream the DER encoding of this object.
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
os - The output stream to write the encoding to.
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the input stream and initializes the key pair.
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
is - The stream to read from.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-03


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