Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSelfSignedCert ¶
GenerateSelfSignedCert generates a self-signed X.509 certificate and private key, saving them to the provided file paths.
It generates a new ECDSA P-256 private key. It sets the certificate fields like validity period, subject, extensions etc. based on best practices. Finally, it encodes the certificate and private key in PEM format and saves them to the provided file paths.
Types ¶
type KeyManager ¶
type KeyManager struct { Libp2pPrivKey crypto.PrivKey // Libp2p private key Libp2pPubKey crypto.PubKey // Libp2p public key EcdsaPrivKey *ecdsa.PrivateKey // ECDSA private key EcdsaPubKey *ecdsa.PublicKey // ECDSA public key HexPrivKey string // Hex-encoded private key HexPubKey string // Hex-encoded public key EthAddress string // Ethereum format address }
KeyManager holds all the cryptographic entities used in the application.
func KeyManagerInstance ¶
func KeyManagerInstance() *KeyManager
KeyManagerInstance returns the singleton instance of KeyManager, initializing it if necessary.
Click to show internal directories.
Click to hide internal directories.