org.apache.abdera.security.util
Class DHContext
java.lang.Object
org.apache.abdera.security.util.DHContext
- All Implemented Interfaces:
- Serializable, Cloneable
public class DHContext
- extends Object
- implements Cloneable, Serializable
Implements the Diffie-Hellman Key Exchange details for both parties Party A: DHContext context_a = new DHContext();
String req = context_a.getRequestString(); Party B: DHContext context_b = new DHContext(req); EncryptionOptions
options = context_b.getEncryptionOptions(enc); // encrypt String ret = context_b.getResponseString(); Party A:
context_a.setPublicKey(ret); EncryptionOptions options = context_a.getEncryptionOptions(enc); // decrypt
- See Also:
- Serialized Form
DHContext
public DHContext()
DHContext
public DHContext(String dh)
getRequestString
public String getRequestString()
getResponseString
public String getResponseString()
getKeyPair
public KeyPair getKeyPair()
getPublicKey
public Key getPublicKey()
setPublicKey
public DHContext setPublicKey(String dh)
throws NoSuchAlgorithmException,
InvalidKeySpecException
- Throws:
NoSuchAlgorithmException
InvalidKeySpecException
generateSecret
public Key generateSecret()
throws NoSuchAlgorithmException,
InvalidKeyException
- Throws:
NoSuchAlgorithmException
InvalidKeyException
getEncryptionOptions
public EncryptionOptions getEncryptionOptions(Encryption enc)
throws InvalidKeyException,
NoSuchAlgorithmException
- Throws:
InvalidKeyException
NoSuchAlgorithmException
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.