All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.casper.sdk.model.account.PublicKeyIdentifier Maven / Gradle / Ivy

Go to download

SDK to streamline the 3rd party Java client integration processes. Such 3rd parties include exchanges & app developers.

The newest version!
package com.casper.sdk.model.account;

import com.casper.sdk.exception.CasperClientException;
import com.casper.sdk.model.key.PublicKey;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.security.NoSuchAlgorithmException;

/**
 * The public key of an account.
 *
 * @author [email protected]
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
public class PublicKeyIdentifier implements AccountIdentifier {

    /** Public key hash */
    @JsonProperty("PublicKey")
    private PublicKey publicKey;

    public PublicKeyIdentifier(final String hexKey) {
        try {
            this.publicKey = PublicKey.fromTaggedHexString(hexKey);
        } catch (NoSuchAlgorithmException e) {
            throw new CasperClientException("Invalid public key bytes", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy