mirror of
https://github.com/kubernetes/client-go.git
synced 2026-06-28 21:19:38 +00:00
Add a new field GenerateKey in the Config struct that allows the user to set a custom function that would generate a private key of their choice. If the field is not set, the default remains: ecdsa.GenerateKey(elliptic.P256(), rand.Reader) Add unit tests for this code path, with key fixtures and function overloading to avoid additional key generation. Enforce minimum bits on the generated keys to ensure they are secure with the function validateKeyStrength(). For RSA the minimum key size is 2048, for ECDSA the minimum curve bits are 256. Unit test this function too. Kubernetes-commit: dec94de30f90f7e7e2859701ffce79ef8b137e3d