- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for CreateRandBytes (0.95 sec)
-
cmd/kubeadm/app/util/crypto/crypto.go
limitations under the License. */ package crypto import ( "crypto/aes" "crypto/cipher" "crypto/rand" "github.com/pkg/errors" ) // CreateRandBytes returns a cryptographically secure slice of random bytes with a given size func CreateRandBytes(size uint32) ([]byte, error) { bytes := make([]byte, size) if _, err := rand.Read(bytes); err != nil { return nil, err } return bytes, nil }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Sun Jul 04 08:41:27 UTC 2021 - 2.1K bytes - Viewed (0) -
cmd/kubeadm/app/util/crypto/crypto_test.go
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants" ) func TestEncryptAndDecryptData(t *testing.T) { key1, err := CreateRandBytes(kubeadmconstants.CertificateKeySize) if err != nil { t.Fatal(err) } key2, err := CreateRandBytes(kubeadmconstants.CertificateKeySize) if err != nil { t.Fatal(err) } testData := []byte("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Aug 17 14:40:46 UTC 2021 - 2.4K bytes - Viewed (0)