Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CreateRandBytes (0.13 sec)

  1. 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)
  2. cmd/kubeadm/app/phases/copycerts/copycerts.go

    	}
    	return tokens[0].Token.ID, nil
    }
    
    // CreateCertificateKey returns a cryptographically secure random key
    func CreateCertificateKey() (string, error) {
    	randBytes, err := cryptoutil.CreateRandBytes(kubeadmconstants.CertificateKeySize)
    	if err != nil {
    		return "", err
    	}
    	return hex.EncodeToString(randBytes), nil
    }
    
    // UploadCerts save certs needs to join a new control-plane on kubeadm-certs sercret.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Jan 01 00:15:30 UTC 2023
    - 10.2K bytes
    - Viewed (0)
Back to top