Package org.drasyl.identity
Class CompressedPublicKey
- java.lang.Object
-
- org.drasyl.identity.CompressedPublicKey
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
compressedKey
protected K
key
static int
LEGACY_KEY_LENGTH
static InternPool<CompressedPublicKey>
POOL
static short
PUBLIC_KEY_LENGTH
-
Constructor Summary
Constructors Constructor Description CompressedPublicKey(String compressedKey)
Deprecated, for removal: This API element is subject to removal in a future version.Useof(String)
instead.CompressedPublicKey(PublicKey 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()
CompressedPublicKey
intern()
static CompressedPublicKey
of(byte[] compressedKey)
Converts a byte[] into aCompressedPublicKey
.static CompressedPublicKey
of(String compressedKey)
Converts aString
into aCompressedPublicKey
.String
toString()
PublicKey
toUncompressedKey()
Returns thePublicKey
object of this compressed public key.
-
-
-
Field Detail
-
PUBLIC_KEY_LENGTH
public static final short PUBLIC_KEY_LENGTH
- See Also:
- Constant Field Values
-
POOL
public static final InternPool<CompressedPublicKey> 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
-
CompressedPublicKey
@Deprecated(since="0.4.0", forRemoval=true) public CompressedPublicKey(String compressedKey)
Deprecated, for removal: This API element is subject to removal in a future version.Useof(String)
instead.Creates a new compressed public key from the given string.- Parameters:
compressedKey
- compressed public key- Throws:
NullPointerException
- ifcompressedKey
isnull
IllegalArgumentException
- ifcompressedKey
does not conform to a valid string
-
CompressedPublicKey
@Deprecated(since="0.4.0", forRemoval=true) public CompressedPublicKey(PublicKey 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 public key from the given public key.- Parameters:
key
- compressed public 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 CompressedPublicKey of(String compressedKey)
Converts aString
into aCompressedPublicKey
.- Parameters:
compressedKey
- compressed key as String- Returns:
CompressedPublicKey
- Throws:
NullPointerException
- ifcompressedKey
isnull
IllegalArgumentException
- ifcompressedKey
does not conform to a valid key string
-
of
public static CompressedPublicKey of(byte[] compressedKey)
Converts a byte[] into aCompressedPublicKey
.- Parameters:
compressedKey
- public key- Returns:
CompressedPublicKey
- Throws:
NullPointerException
- ifcompressedKey
isnull
-
toUncompressedKey
public PublicKey toUncompressedKey()
Returns thePublicKey
object of this compressed public key.- Throws:
IllegalStateException
- if uncompressed public key could not be generated
-
intern
public CompressedPublicKey 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.
-
-