JXTA

jxta.security.impl.jxtasec
Class JxtaSec1

java.lang.Object
  |
  +--jxta.security.impl.jxtasec.JxtaSec1

public class JxtaSec1
extends java.lang.Object


Constructor Summary
JxtaSec1()
           
 
Method Summary
 void clearDebug()
           
 byte[] decryptData(byte[] data)
          Return data URLBase64 decoded, and then decrypted with the session key.
 byte[] encryptData(byte[] data)
          Return data encrypted with the session key in URLBase64.
 byte[] getOurRSAPublicKey()
           
 java.lang.Object getRSAPrivateKeyData()
          Get rsa private key data for local storage
 java.lang.Object getRSAPublicKeyData()
          Get rsa public key data for local storage
 byte[] getSessionKey(byte[] encodedRSApublicKey)
          We have received an encoded RSA Public Key from the other peer: We return the session key as a base64 string encrpted in the other peers public key.
 boolean jxtaSecInit()
          Initialize security variables
 boolean jxtaSecInit(java.lang.Object publicKeyData, java.lang.Object privateKeyData)
          Initialize with previous RSA public/private key values
 void reset()
          Reset the object
 void setDebug()
           
 void setSessionKey(byte[] encryptedSKey)
          We have received a session key encrypted in our RSA public key and base64 encoded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JxtaSec1

public JxtaSec1()
Method Detail

setDebug

public void setDebug()

clearDebug

public void clearDebug()

jxtaSecInit

public boolean jxtaSecInit()
Initialize security variables

jxtaSecInit

public boolean jxtaSecInit(java.lang.Object publicKeyData,
                           java.lang.Object privateKeyData)
Initialize with previous RSA public/private key values

getOurRSAPublicKey

public byte[] getOurRSAPublicKey()
                          throws jxta.security.exceptions.CryptoException

getSessionKey

public byte[] getSessionKey(byte[] encodedRSApublicKey)
                     throws jxta.security.exceptions.CryptoException
We have received an encoded RSA Public Key from the other peer: We return the session key as a base64 string encrpted in the other peers public key. The remote peer will use the session key we send for encrypting data.

setSessionKey

public void setSessionKey(byte[] encryptedSKey)
                   throws jxta.security.exceptions.CryptoException
We have received a session key encrypted in our RSA public key and base64 encoded. We decrypt it, and set it as our symmetric session key for data.

decryptData

public byte[] decryptData(byte[] data)
                   throws jxta.security.exceptions.CryptoException
Return data URLBase64 decoded, and then decrypted with the session key.

encryptData

public byte[] encryptData(byte[] data)
                   throws jxta.security.exceptions.CryptoException
Return data encrypted with the session key in URLBase64.

getRSAPublicKeyData

public java.lang.Object getRSAPublicKeyData()
                                     throws jxta.security.exceptions.CryptoException
Get rsa public key data for local storage

getRSAPrivateKeyData

public java.lang.Object getRSAPrivateKeyData()
                                      throws jxta.security.exceptions.CryptoException
Get rsa private key data for local storage

reset

public void reset()
Reset the object

JXTA