Source File
rsa_common.go
Belonging Package
github.com/libp2p/go-libp2p/core/crypto
package cryptoimport ()// WeakRsaKeyEnv is an environment variable which, when set, lowers the// minimum required bits of RSA keys to 512. This should be used exclusively in// test situations.const WeakRsaKeyEnv = "LIBP2P_ALLOW_WEAK_RSA_KEYS"var MinRsaKeyBits = 2048var maxRsaKeyBits = 8192// ErrRsaKeyTooSmall is returned when trying to generate or parse an RSA key// that's smaller than MinRsaKeyBits bits. In testvar ErrRsaKeyTooSmall errorvar ErrRsaKeyTooBig error = fmt.Errorf("rsa keys must be <= %d bits", maxRsaKeyBits)func init() {if , := os.LookupEnv(WeakRsaKeyEnv); {MinRsaKeyBits = 512}ErrRsaKeyTooSmall = fmt.Errorf("rsa keys must be >= %d bits to be useful", MinRsaKeyBits)}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |