Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for privPem (0.22 sec)

  1. security/pkg/pki/util/keycertbundle.go

    // NOTE: Callers should not modify the content of cert and privKey.
    func (b *KeyCertBundle) GetAll() (cert *x509.Certificate, privKey *crypto.PrivateKey, certChainBytes,
    	rootCertBytes []byte,
    ) {
    	b.mutex.RLock()
    	cert = b.cert
    	privKey = b.privKey
    	certChainBytes = copyBytes(b.certChainBytes)
    	rootCertBytes = copyBytes(b.rootCertBytes)
    	b.mutex.RUnlock()
    	return
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jan 21 06:07:50 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  2. security/pkg/pki/util/crypto.go

    	}
    }
    
    // GetRSAKeySize returns the size if it is RSA key, otherwise it returns an error.
    func GetRSAKeySize(privKey crypto.PrivateKey) (int, error) {
    	if t := reflect.TypeOf(privKey); t != reflect.TypeOf(&rsa.PrivateKey{}) {
    		return 0, fmt.Errorf("key type is not RSA: %v", t)
    	}
    	pkey := privKey.(*rsa.PrivateKey)
    	return pkey.N.BitLen(), nil
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Jun 04 13:00:07 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  3. src/crypto/ecdsa/ecdsa_test.go

    	zeroHash := make([]byte, 64)
    
    	privKey, err := GenerateKey(curve, rand.Reader)
    	if err != nil {
    		panic(err)
    	}
    
    	// Sign a hash consisting of all zeros.
    	r, s, err := Sign(rand.Reader, privKey, zeroHash)
    	if err != nil {
    		panic(err)
    	}
    
    	// Confirm that it can be verified.
    	if !Verify(&privKey.PublicKey, zeroHash, r, s) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:58 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  4. docs/debugging/inspect/decrypt-v2.go

    	error
    }
    
    func extractInspectV2(pk []byte, r io.Reader, w io.Writer, okMsg string) error {
    	privKey, err := bytesToPrivateKey(pk)
    	if err != nil {
    		return fmt.Errorf("decoding key returned: %w", err)
    	}
    
    	sr, err := estream.NewReader(r)
    	if err != nil {
    		return err
    	}
    
    	sr.SetPrivateKey(privKey)
    	sr.ReturnNonDecryptable(true)
    
    	// Debug corrupted streams.
    	if false {
    		sr.SkipEncrypted(true)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 11 21:22:47 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  5. cmd/kubeadm/app/util/pkiutil/testing/testing.go

    		ecdsa++
    		keyName = fmt.Sprintf("%d.ecdsa", ecdsa)
    	default:
    		rsa++
    		keyName = fmt.Sprintf("%d.rsa", rsa)
    	}
    
    	if len(keyName) > 0 {
    		privKey, err := pkiutil.TryLoadKeyFromDisk(fixtureDir, keyName)
    		if err == nil {
    			return privKey, nil
    		}
    	}
    
    	fmt.Println("GeneratePrivateKey " + keyName + " for " + thisTest)
    
    	signer, err := pkiutil.GeneratePrivateKey(keyType)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 31 21:49:21 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. security/pkg/pki/util/keycertbundle_test.go

    			}
    
    			root = bundle.GetRootCertPem()
    			if len(root) == 0 {
    				t.Errorf("%s: rootCertBytes should not be empty", id)
    			}
    
    			x509Cert, privKey, chain, root := bundle.GetAll()
    			if x509Cert != nil {
    				t.Errorf("%s: cert should be nil", id)
    			}
    			if privKey != nil {
    				t.Errorf("%s: private key should be nil", id)
    			}
    			if len(chain) != 0 {
    				t.Errorf("%s: certChainBytes should be empty", id)
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun Jan 21 06:07:50 UTC 2024
    - 15.8K bytes
    - Viewed (0)
  7. cmd/kubeadm/app/util/pkiutil/pki_helpers.go

    	privateKeyPath := pathForKey(pkiPath, name)
    
    	// Parse the private key from a file
    	privKey, err := keyutil.PrivateKeyFromFile(privateKeyPath)
    	if err != nil {
    		return nil, errors.Wrapf(err, "couldn't load the private key file %s", privateKeyPath)
    	}
    
    	// Allow RSA and ECDSA formats only
    	var key crypto.Signer
    	switch k := privKey.(type) {
    	case *rsa.PrivateKey:
    		key = k
    	case *ecdsa.PrivateKey:
    		key = k
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 01 16:01:49 UTC 2024
    - 25.5K bytes
    - Viewed (0)
  8. src/crypto/rsa/rsa_test.go

    		GenerateMultiPrimeKey(rand.Reader, 4, i)
    		GenerateMultiPrimeKey(rand.Reader, 5, i)
    	}
    }
    
    func TestGnuTLSKey(t *testing.T) {
    	// This is a key generated by `certtool --generate-privkey --bits 128`.
    	// It's such that de ≢ 1 mod φ(n), but is congruent mod the order of
    	// the group.
    	priv := parseKey(testingKey(`-----BEGIN RSA TESTING KEY-----
    MGECAQACEQDar8EuoZuSosYtE9SeXSyPAgMBAAECEBf7XDET8e6jjTcfO7y/sykC
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 12 00:55:41 UTC 2024
    - 30.9K bytes
    - Viewed (0)
Back to top