commit inicial do projeto

This commit is contained in:
Júnior
2025-05-23 10:44:32 -03:00
commit 8f04473c0b
106 changed files with 5673 additions and 0 deletions

27
internal/config/config.go Normal file
View File

@ -0,0 +1,27 @@
package config
import (
"crypto/ecdsa"
"sync"
)
var (
GlobalPrivateKey *ecdsa.PrivateKey
GlobalPublicKey *ecdsa.PublicKey
once sync.Once
)
// SetGlobalKeys configura a chave privada e pública globais, se ainda não estiverem definidas.
func SetGlobalKeys(priv *ecdsa.PrivateKey, pub *ecdsa.PublicKey) {
once.Do(func() {
GlobalPrivateKey = priv
GlobalPublicKey = pub
})
}
// ResetGlobalKeys limpa as chaves globais (usado em testes)
func ResetGlobalKeys() {
GlobalPrivateKey = nil
GlobalPublicKey = nil
once = sync.Once{}
}