Documentation ¶
Index ¶
- Variables
- func CreateP2pKeyPair(keyFileName string, keyGen crypto.KeyGenerator, log logger.Logger) (crypto.PrivateKey, crypto.PublicKey, error)
- func NewCryptoComponentsFactory(args CryptoComponentsFactoryArgs) (*cryptoComponentsFactory, error)
- func NewManagedCryptoComponents(ccf *cryptoComponentsFactory) (*managedCryptoComponents, error)
- func NewMultiSignerContainer(args MultiSigArgs, multiSignerConfig []config.MultiSignerConfig) (*container, error)
- func NewSigningHandler(args ArgsSigningHandler) (*signingHandler, error)
- type ArgsSigningHandler
- type CryptoComponentsFactoryArgs
- type CryptoComponentsHandlerArgs
- type MultiSigArgs
Constants ¶
This section is empty.
Variables ¶
var ErrBitmapMismatch = errors.New("multi signer reported a mismatch in used bitmap")
ErrBitmapMismatch is raised when an invalid bitmap is passed to the multisigner
var ErrEmptyPubKeyString = errors.New("public key string is empty")
ErrEmptyPubKeyString is raised when an empty public key string is used
var ErrIndexOutOfBounds = errors.New("index is out of bounds")
ErrIndexOutOfBounds is raised when an out of bound index is used
var ErrInvalidSignature = errors.New("invalid signature was provided")
ErrInvalidSignature is raised for an invalid signature
var ErrNilBitmap = errors.New("bitmap is nil")
ErrNilBitmap is raised when a nil bitmap is used
var ErrNilElement = errors.New("element is nil")
ErrNilElement is raised when searching for a specific element but found nil
var ErrNilKeyGenerator = errors.New("key generator is nil")
ErrNilKeyGenerator is raised when a valid key generator is expected but nil used
var ErrNilKeysHandler = errors.New("nil keys handler")
ErrNilKeysHandler is raised when a nil keys handler was provided
var ErrNilMessage = errors.New("message to be signed or to be verified is nil")
ErrNilMessage is raised when trying to verify a nil signed message or trying to sign a nil message
var ErrNilMultiSignerContainer = errors.New("multi signer container is nil")
ErrNilMultiSignerContainer is raised when a nil multi signer container has been provided
var ErrNilPublicKeys = errors.New("public keys are nil")
ErrNilPublicKeys is raised when public keys are expected but received nil
var ErrNilSingleSigner = errors.New("nil single signer")
ErrNilSingleSigner signals that a nil single signer was provided
var ErrNoPublicKeySet = errors.New("no public key was set")
ErrNoPublicKeySet is raised when no public key was set for a multisignature
Functions ¶
func CreateP2pKeyPair ¶
func CreateP2pKeyPair( keyFileName string, keyGen crypto.KeyGenerator, log logger.Logger, ) (crypto.PrivateKey, crypto.PublicKey, error)
CreateP2pKeyPair will create a set of key pair for p2p based on provided pem file. If the provided key is empty it will generate a new one
func NewCryptoComponentsFactory ¶
func NewCryptoComponentsFactory(args CryptoComponentsFactoryArgs) (*cryptoComponentsFactory, error)
NewCryptoComponentsFactory returns a new crypto components factory
func NewManagedCryptoComponents ¶
func NewManagedCryptoComponents(ccf *cryptoComponentsFactory) (*managedCryptoComponents, error)
NewManagedCryptoComponents creates a new Crypto components handler
func NewMultiSignerContainer ¶
func NewMultiSignerContainer(args MultiSigArgs, multiSignerConfig []config.MultiSignerConfig) (*container, error)
NewMultiSignerContainer creates the multiSignerContainer container
func NewSigningHandler ¶ added in v1.6.0
func NewSigningHandler(args ArgsSigningHandler) (*signingHandler, error)
NewSigningHandler will create a new signing handler component
Types ¶
type ArgsSigningHandler ¶ added in v1.6.0
type ArgsSigningHandler struct { PubKeys []string MultiSignerContainer cryptoCommon.MultiSignerContainer SingleSigner crypto.SingleSigner KeyGenerator crypto.KeyGenerator KeysHandler consensus.KeysHandler }
ArgsSigningHandler defines the arguments needed to create a new signing handler component
type CryptoComponentsFactoryArgs ¶
type CryptoComponentsFactoryArgs struct { ValidatorKeyPemFileName string AllValidatorKeysPemFileName string SkIndex int Config config.Config EnableEpochs config.EnableEpochs PrefsConfig config.Preferences CoreComponentsHolder factory.CoreComponentsHolder KeyLoader factory.KeyLoaderHandler ActivateBLSPubKeyMessageVerification bool IsInImportMode bool ImportModeNoSigCheck bool P2pKeyPemFileName string }
CryptoComponentsFactoryArgs holds the arguments needed for creating crypto components
type CryptoComponentsHandlerArgs ¶
type CryptoComponentsHandlerArgs CryptoComponentsFactoryArgs
CryptoComponentsHandlerArgs holds the arguments required to create a crypto components handler
type MultiSigArgs ¶
type MultiSigArgs struct { MultiSigHasherType string BlSignKeyGen crypto.KeyGenerator ConsensusType string ImportModeNoSigCheck bool }
MultiSigArgs holds the arguments for creating the multiSignerContainer container