Documentation ¶
Index ¶
- Constants
- Variables
- func AddSignatureToTransaction(tx build.TransactionEnvelopeBuilder, signature []byte, publicKey string) (build.TransactionEnvelopeBuilder, error)
- func FindHSMObject(c *hsm.Crypto, slot uint, label string) ([]byte, pkcs11.ObjectHandle, error)
- func GenerateKeyPair(c *hsm.Crypto, slot uint, label1, label2 string) (string, string, pkcs11.ObjectHandle, pkcs11.ObjectHandle, []uint8, error)
- func GenerateStellarAccount(ecPoints []uint8) string
- func GetSignatureAndAddToTransaction(c hsm.Crypto, privateKeyObject pkcs11.ObjectHandle, slot uint, txHash []byte, ...) (txe build.TransactionEnvelopeBuilder, err error)
- func ParseErrorMsg(err error) string
- func SignDataWithPrivateKey(c hsm.Crypto, privateKeyObject pkcs11.ObjectHandle, slot uint, data []byte) ([]byte, error)
- func VerifyDataWithPublicKey(c hsm.Crypto, publicKeyObject pkcs11.ObjectHandle, slot uint, data []byte, ...) error
- func VerifyDataWithPublicNodeAddress(publicKey string, data []byte, sig []byte) error
Constants ¶
View Source
const NULL_HANDLE_ID = "NULL_HANDLE_ID"
View Source
const SESSION_HANDLE_INVALID = "0xB3"
View Source
const SIGNING_ERROR = "0x8000001A"
View Source
const UNIDENTIFIED_ERROR = "Unknown Error Message from HSM"
Variables ¶
View Source
var LOGGER = logging.MustGetLogger("hsm-client")
Functions ¶
func AddSignatureToTransaction ¶
func AddSignatureToTransaction(tx build.TransactionEnvelopeBuilder, signature []byte, publicKey string) (build.TransactionEnvelopeBuilder, error)
func FindHSMObject ¶
func GenerateKeyPair ¶
func GenerateKeyPair(c *hsm.Crypto, slot uint, label1, label2 string) (string, string, pkcs11.ObjectHandle, pkcs11.ObjectHandle, []uint8, error)
Generate key pair and get the label of public key and private key from HSM. Use the public key label to get the CKA_EC_POINT. Need to initiate the HSM first.
func GenerateStellarAccount ¶
Using public key's CKA_EC_POINT from the HSM to generate the Stellar account.
func GetSignatureAndAddToTransaction ¶
func GetSignatureAndAddToTransaction(c hsm.Crypto, privateKeyObject pkcs11.ObjectHandle, slot uint, txHash []byte, tx build.TransactionEnvelopeBuilder, publicKey string) (txe build.TransactionEnvelopeBuilder, err error)
Signing the transaction hash with the handle id of private key. Need to initiate the HSM and get the private jey object handle id first. Add both the signature and the hint parse from public key to the transaction.
func ParseErrorMsg ¶
func SignDataWithPrivateKey ¶
func VerifyDataWithPublicKey ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.