Package org.drasyl.identity
Class CompressedPrivateKey
- java.lang.Object
-
- org.drasyl.identity.CompressedPrivateKey
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
compressedKey
protected K
key
static int
LEGACY_KEY_LENGTH
static InternPool<CompressedPrivateKey>
POOL
static short
PRIVATE_KEY_LENGTH
-
Constructor Summary
Constructors Constructor Description CompressedPrivateKey(String compressedKey)
Deprecated, for removal: This API element is subject to removal in a future version.Useof(String)
instead.CompressedPrivateKey(PrivateKey key)
Deprecated, for removal: This API element is subject to removal in a future version.this will be removed in the next release.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
byteArrayValue()
boolean
equals(Object o)
String
getCompressedKey()
Deprecated, for removal: This API element is subject to removal in a future version.UseObject.toString()
()} instead.int
hashCode()
CompressedPrivateKey
intern()
static CompressedPrivateKey
of(byte[] compressedKey)
Converts a byte[] into aCompressedPrivateKey
.static CompressedPrivateKey
of(String compressedKey)
Converts aString
into aCompressedPrivateKey
.String
toString()
PrivateKey
toUncompressedKey()
Returns thePrivateKey
object of this compressed private key.
-
-
-
Field Detail
-
PRIVATE_KEY_LENGTH
public static final short PRIVATE_KEY_LENGTH
- See Also:
- Constant Field Values
-
POOL
public static final InternPool<CompressedPrivateKey> POOL
-
LEGACY_KEY_LENGTH
public static final int LEGACY_KEY_LENGTH
- See Also:
- Constant Field Values
-
compressedKey
protected final byte[] compressedKey
-
key
protected K key
-
-
Constructor Detail
-
CompressedPrivateKey
@Deprecated(since="0.4.0", forRemoval=true) public CompressedPrivateKey(String compressedKey)
Deprecated, for removal: This API element is subject to removal in a future version.Useof(String)
instead.Creates a new compressed private key from the given string.- Parameters:
compressedKey
- compressed private key- Throws:
IllegalArgumentException
- if the string parameter does not conform to a valid key
-
CompressedPrivateKey
@Deprecated(since="0.4.0", forRemoval=true) public CompressedPrivateKey(PrivateKey key) throws CryptoException
Deprecated, for removal: This API element is subject to removal in a future version.this will be removed in the next release.Creates a new compressed private key from the given private key.- Parameters:
key
- compressed private key- Throws:
IllegalArgumentException
- if parameter does not conform to a valid hexadecimal stringCryptoException
- if the parameter does not conform to a valid key
-
-
Method Detail
-
of
public static CompressedPrivateKey of(String compressedKey)
Converts aString
into aCompressedPrivateKey
.- Parameters:
compressedKey
- compressed key as String- Returns:
CompressedPublicKey
- Throws:
IllegalArgumentException
- if string parameter does not conform to a valid key
-
of
public static CompressedPrivateKey of(byte[] compressedKey)
Converts a byte[] into aCompressedPrivateKey
.- Parameters:
compressedKey
- compressed key as byte array- Returns:
CompressedPublicKey
-
toUncompressedKey
public PrivateKey toUncompressedKey()
Returns thePrivateKey
object of this compressed private key.- Throws:
IllegalStateException
- if uncompressed private key could not be generated
-
intern
public CompressedPrivateKey intern()
-
byteArrayValue
public byte[] byteArrayValue()
-
getCompressedKey
@Deprecated(since="0.4.0", forRemoval=true) public String getCompressedKey()
Deprecated, for removal: This API element is subject to removal in a future version.UseObject.toString()
()} instead.
-
-