Package com.wolfssl.wolfcrypt
Class EccKey
- java.lang.Object
-
- com.wolfssl.wolfcrypt.EccKey
-
public class EccKey extends java.lang.Object
Wraps a native ecc_key structure pointer.- Version:
- 1.0, December 2017
- Author:
- wolfSSL
-
-
Constructor Summary
Constructors Constructor Description EccKey(long keyPtr)
Create new EccKey object, wrapping native ecc_key with pointer keyPtr.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
byte[]
getPrivateKeyDer()
Return ECC private key in DER formatbyte[]
getPrivateKeyPKCS8()
Return ECC private key DER in PKCS#8 formatbyte[]
getPublicKeyDer()
Return ECC public key in DER format
-
-
-
Constructor Detail
-
EccKey
public EccKey(long keyPtr) throws WolfSSLException
Create new EccKey object, wrapping native ecc_key with pointer keyPtr.- Parameters:
keyPtr
- pointer to native ecc_key structure- Throws:
WolfSSLException
- if key object creation failed
-
-
Method Detail
-
getPublicKeyDer
public byte[] getPublicKeyDer() throws java.lang.IllegalStateException
Return ECC public key in DER format- Returns:
- the raw ECC public key as a byte array.
- Throws:
java.lang.IllegalStateException
-
getPrivateKeyDer
public byte[] getPrivateKeyDer()
Return ECC private key in DER format- Returns:
- the raw ECC private key as a byte array, not PKCS#8 formatted.
-
getPrivateKeyPKCS8
public byte[] getPrivateKeyPKCS8()
Return ECC private key DER in PKCS#8 format- Returns:
- ECC private key DER in PKCS#8 format.
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-