Package org.drasyl.identity
Class CompressedPrivateKey
java.lang.Object
org.drasyl.identity.CompressedPrivateKey
- All Implemented Interfaces:
- Address
This interface models a compressed key that can be converted into a string and vice versa.
 
This is an immutable object.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionCompressedPrivateKey(String compressedKey) Creates a new compressed private key from the given string.Creates a new compressed private key from the given private key.
- 
Method SummaryModifier and TypeMethodDescriptionbooleaninthashCode()static CompressedPrivateKeyConverts aStringinto aCompressedPrivateKey.static CompressedPrivateKeyof(PrivateKey key) Converts aPrivateKeyinto aCompressedPrivateKey.toString()Returns thePrivateKeyobject of this compressed private key.
- 
Field Details- 
compressedKey
- 
key
 
- 
- 
Constructor Details- 
CompressedPrivateKeyCreates a new compressed private key from the given string.- Parameters:
- compressedKey- compressed private key
- Throws:
- IllegalArgumentException- if string parameter does not conform to a valid hexadecimal string
- CryptoException- if the string parameter does not conform to a valid key
 
- 
CompressedPrivateKeyCreates 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 string
- CryptoException- if the parameter does not conform to a valid key
 
 
- 
- 
Method Details- 
toUncompressedKeyReturns thePrivateKeyobject of this compressed private key.- Throws:
- IllegalArgumentException- if string parameter does not conform to a valid hexadecimal string
- CryptoException- if the string parameter does not conform to a valid key
 
- 
ofConverts aStringinto aCompressedPrivateKey.- Parameters:
- compressedKey- compressed key as String
- Returns:
- CompressedPublicKey
- Throws:
- CryptoException- if string parameter does not conform to a valid key
- IllegalArgumentException- if string parameter does not conform to a valid hexadecimal string
 
- 
ofConverts aPrivateKeyinto aCompressedPrivateKey.- Parameters:
- key- private key
- Returns:
- CompressedPublicKey
- Throws:
- CryptoException- if string parameter does not conform to a valid key
- IllegalArgumentException- if string parameter does not conform to a valid hexadecimal string
 
- 
getCompressedKey
- 
hashCodepublic int hashCode()
- 
equals
- 
toString
 
-