cgl.narada.discovery.topics.messages
Class EncryptedMessagePayload

java.lang.Object
  extended by cgl.narada.discovery.topics.messages.EncryptedMessagePayload
All Implemented Interfaces:
Serializable

public class EncryptedMessagePayload
extends Object
implements Serializable

Encapsulates the encrupted key and encrupted Payload
Created on Apr 18, 2005

See Also:
Serialized Form

Method Summary
static EncryptedMessagePayload createObjectFromBytes(byte[] objectBytes)
           
static EncryptedMessagePayload generate(byte[] payload, PublicKey pubkey)
          Creates a new secret key, encrypts the payload with the new SecretKey.
 byte[] getBytes()
           
 byte[] getDecryptedPayload(PrivateKey privatekey)
          Returns the decrypted payload.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytes

public byte[] getBytes()

createObjectFromBytes

public static EncryptedMessagePayload createObjectFromBytes(byte[] objectBytes)

generate

public static EncryptedMessagePayload generate(byte[] payload,
                                               PublicKey pubkey)
Creates a new secret key, encrypts the payload with the new SecretKey. Then using the public key, the secret key is encoded and a new instance of EncryptedMessagePAyload is returned

Parameters:
payload -
Returns:

getDecryptedPayload

public byte[] getDecryptedPayload(PrivateKey privatekey)
Returns the decrypted payload. Decryption is done using the private key

Parameters:
privatekey - - private key for decrypting the secret key
Returns:
array of payload bytes if successful, NULL otherwise

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project