graphenej/src/main/java/de/bitsharesmunich/graphenej/PublicKey.java

29 lines
576 B
Java

package de.bitsharesmunich.graphenej;
import de.bitsharesmunich.graphenej.interfaces.ByteSerializable;
import org.bitcoinj.core.ECKey;
/**
* Created by nelson on 11/30/16.
*/
public class PublicKey implements ByteSerializable {
private ECKey publicKey;
public PublicKey(ECKey key) {
this.publicKey = key;
}
public ECKey getKey(){
return publicKey;
}
@Override
public byte[] toBytes() {
return publicKey.getPubKey();
}
public String getAddress(){
return new Address(publicKey).toString();
}
}