public class BTCPayServerHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
log |
Constructor and Description |
---|
BTCPayServerHelper() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
genSignature(java.security.PrivateKey privateKey,
java.lang.String requestURL,
java.lang.String data)
Method to generate a signature header value in BTC Pay Server request, by first appending requestURL and data
and then sign it using the private key an ECDSAWithSHA256 algorithm and converting it into hex.
|
java.lang.String |
pubKeyInHex(java.security.interfaces.ECPublicKey publicKey)
Help method to generate the hex representation of a public key used in BTC Pay Server
to identify an access key.
|
java.lang.String |
toSIN(java.lang.String publicKeyHex)
Method to generate a SIN for a given EC Public Key encoded in hex format.
|
public java.lang.String pubKeyInHex(java.security.interfaces.ECPublicKey publicKey) throws InternalErrorException
publicKey
- the public key to convert to BTCPay hex representation.InternalErrorException
- if problems occurred converting the public key.public java.lang.String genSignature(java.security.PrivateKey privateKey, java.lang.String requestURL, java.lang.String data) throws InternalErrorException
privateKey
- the private key to use when signing.requestURL
- the request URL done.data
- the request data (usually the JSON data about to be sent).InternalErrorException
- if problems occurred generating the signature.public java.lang.String toSIN(java.lang.String publicKeyHex) throws InternalErrorException
publicKeyHex
- hex encoded compressed Q value of public key, same value as uploaded
to BTC Pay Server.InternalErrorException
- if internal errors occurred generating the SIN Value.