common

package
v0.0.0-...-1305305 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LOGGER = logging.MustGetLogger("utils")

Functions

func InitiateHSM

func InitiateHSM() (*hsm.Crypto, uint, pkcs11.SessionHandle)

Open a HSM session with the specific slot then login with the pin code.

func LogoutHSM

func LogoutHSM(c *hsm.Crypto, session pkcs11.SessionHandle) error

func RandStringBytes

func RandStringBytes(n int) string

func ReinitializeHSM

func ReinitializeHSM(c *hsm.Crypto, session pkcs11.SessionHandle) (*hsm.Crypto, pkcs11.SessionHandle, error)

Types

type HsmObject

type HsmObject struct {
	C       *hsm.Crypto
	Slot    uint
	Session pkcs11.SessionHandle
}

func (*HsmObject) GenericGenerateAccount

func (obj *HsmObject) GenericGenerateAccount() (nodeconfig.Account, error)

create a new account using either HSM or Stellar SDK

func (*HsmObject) GenericSign

func (obj *HsmObject) GenericSign(txeBuilder *build.TransactionEnvelopeBuilder, accounts ...nodeconfig.Account) (build.TransactionEnvelopeBuilder, error)

GenericSign for choosing between HSM/Native Stellar signing

func (*HsmObject) GenericSignPayload

func (obj *HsmObject) GenericSignPayload(payload []byte, acc nodeconfig.Account) ([]byte, error)

func (*HsmObject) GenericVerifySignatureIdentity

func (obj *HsmObject) GenericVerifySignatureIdentity(unsignedMsg []byte, signedMsg []byte, account nodeconfig.Account) (bool, error)

func (*HsmObject) SignUsingHSMPrivateKeyHandle

func (obj *HsmObject) SignUsingHSMPrivateKeyHandle(payload []byte, privateKeyLabel string) ([]byte, error)

func (*HsmObject) SignXML

func (obj *HsmObject) SignXML(xml, privateKeyHandle string, publicKey string, signUsingStellar bool) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL