Package org.drasyl.identity
Class Identity
- java.lang.Object
-
- org.drasyl.identity.Identity
-
public abstract class Identity extends Object
Represents the private identity of a peer (includes the proof of work, the public and private key). Should be kept secret!This is an immutable object.
-
-
Constructor Summary
Constructors Constructor Description Identity()
-
Method Summary
-
-
-
Method Detail
-
getProofOfWork
public abstract ProofOfWork getProofOfWork()
-
getIdentityKeyPair
public abstract KeyPair<IdentityPublicKey,IdentitySecretKey> getIdentityKeyPair()
-
getKeyAgreementKeyPair
public abstract KeyPair<KeyAgreementPublicKey,KeyAgreementSecretKey> getKeyAgreementKeyPair()
-
getIdentityPublicKey
public IdentityPublicKey getIdentityPublicKey()
-
getIdentitySecretKey
public IdentitySecretKey getIdentitySecretKey()
-
getAddress
public DrasylAddress getAddress()
Returns the address for this identity.- Returns:
- returns the address for this identity.
-
getKeyAgreementPublicKey
public KeyAgreementPublicKey getKeyAgreementPublicKey()
-
getKeyAgreementSecretKey
public KeyAgreementSecretKey getKeyAgreementSecretKey()
-
isValid
public boolean isValid()
Validates the identity by checking whether the proof of work matches the public key.- Returns:
true
if this identity is valid. Otherwisefalse
-
of
public static Identity of(ProofOfWork proofOfWork, KeyPair<IdentityPublicKey,IdentitySecretKey> identityKeyPair, KeyPair<KeyAgreementPublicKey,KeyAgreementSecretKey> keyAgreementKeyPair)
-
of
public static Identity of(ProofOfWork proofOfWork, IdentityPublicKey identityPublicKey, IdentitySecretKey identitySecretKey)
-
of
public static Identity of(ProofOfWork proofOfWork, KeyPair<IdentityPublicKey,IdentitySecretKey> identityKeyPair)
-
of
public static Identity of(ProofOfWork proofOfWork, String identityPublicKey, String identitySecretKey)
-
of
public static Identity of(int proofOfWork, KeyPair<IdentityPublicKey,IdentitySecretKey> identityKeyPair, KeyPair<KeyAgreementPublicKey,KeyAgreementSecretKey> keyAgreementKeyPair)
-
-