Package org.drasyl.identity
Class CompressedPublicKey
- java.lang.Object
-
- org.drasyl.identity.CompressedPublicKey
-
public class CompressedPublicKey extends Object
This interface models a compressed key that can be converted into a string and vice versa.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
compressedKey
protected K
key
-
Constructor Summary
Constructors Constructor Description CompressedPublicKey(String compressedKey)
CompressedPublicKey(PublicKey key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getCompressedKey()
int
hashCode()
static CompressedPublicKey
of(String compressedKey)
Converts aString
into aCompressedPublicKey
.static CompressedPublicKey
of(PublicKey key)
Converts aPublicKey
into aCompressedPublicKey
.String
toString()
PublicKey
toUncompressedKey()
-
-
-
Field Detail
-
compressedKey
protected final String compressedKey
-
key
protected K key
-
-
Constructor Detail
-
CompressedPublicKey
public CompressedPublicKey(String compressedKey) throws CryptoException
- Throws:
CryptoException
-
CompressedPublicKey
public CompressedPublicKey(PublicKey key) throws CryptoException
- Throws:
CryptoException
-
-
Method Detail
-
toUncompressedKey
public PublicKey toUncompressedKey() throws CryptoException
- Throws:
CryptoException
-
of
public static CompressedPublicKey of(String compressedKey) throws CryptoException
Converts aString
into aCompressedPublicKey
.- Parameters:
compressedKey
- compressed key as String- Returns:
CompressedPublicKey
- Throws:
CryptoException
-
of
public static CompressedPublicKey of(PublicKey key) throws CryptoException
Converts aPublicKey
into aCompressedPublicKey
.- Parameters:
key
- public key- Returns:
CompressedPublicKey
- Throws:
CryptoException
-
getCompressedKey
public String getCompressedKey()
-
-