Package com.wolfssl.wolfcrypt
Class Dh
java.lang.Object
com.wolfssl.wolfcrypt.WolfObject
com.wolfssl.wolfcrypt.NativeStruct
com.wolfssl.wolfcrypt.Dh
public class Dh extends NativeStruct
Wrapper for the native WolfCrypt DH implementation.
- Version:
- 2.0, March 2017
- Author:
- Moisés Guimarães
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected void
free()
byte[]
getPrivateKey()
byte[]
getPublicKey()
protected void
init()
void
makeKey(Rng rng)
byte[]
makeSharedSecret(Dh pubKey)
protected long
mallocNativeStruct()
void
releaseNativeStruct()
Releases the host data stored in a NativeStruct.void
setParams(byte[] p, byte[] g)
void
setPrivateKey(byte[] priv)
void
setPublicKey(byte[] pub)
Methods inherited from class com.wolfssl.wolfcrypt.NativeStruct
finalize, getNativeStruct, setNativeStruct
-
Constructor Details
-
Method Details
-
releaseNativeStruct
public void releaseNativeStruct()Description copied from class:NativeStruct
Releases the host data stored in a NativeStruct. This method provides a way to release host data without depending on the garbage collector to get around to releasing it. Derived objects whose native data structures have their own free functions, should be override this method to call that function.- Overrides:
releaseNativeStruct
in classNativeStruct
-
mallocNativeStruct
protected long mallocNativeStruct() throws java.lang.OutOfMemoryError- Specified by:
mallocNativeStruct
in classNativeStruct
- Throws:
java.lang.OutOfMemoryError
-
init
protected void init() -
free
protected void free() -
setPrivateKey
public void setPrivateKey(byte[] priv) -
setPublicKey
public void setPublicKey(byte[] pub) -
getPublicKey
public byte[] getPublicKey() -
getPrivateKey
public byte[] getPrivateKey() -
setParams
public void setParams(byte[] p, byte[] g) -
makeKey
-
makeSharedSecret
-