// Rekey is used to change the master key used to protect the keyring
508007
func (b *AESGCMBarrier) Rekey(ctx context.Context, key []byte) error {
	b.l.Lock()
	defer b.l.Unlock()

	newKeyring, err := b.updateMasterKeyCommon(key)
	if err != nil {
		return err
	}

	// Persist the new keyring
	if err := b.persistKeyring(ctx, newKeyring); err != nil {
		return err
	}

	// Swap the keyrings
	oldKeyring := b.keyring
	b.keyring = newKeyring
	oldKeyring.Zeroize(false)
	return nil
}
753103
func (s *PlayReadyDrm) SetKey(v string) *PlayReadyDrm {
	s.Key = &v
	return s
}
57843
func (c *cipher) key(key []byte) {
	var word uint
	off := 0
	lr := []uint{0, 0}
	plen := len(c.P)
	slen := len(c.S)

	for i := 0; i < plen; i++ {
		word, off = streamtoword(key, off)
		c.P[i] = c.P[i] ^ word
	}

	for i := 0; i < plen; i += 2 {
		c.encipher(lr, 0)
		c.P[i] = lr[0]
		c.P[i+1] = lr[1]
	}

	for i := 0; i < slen; i += 2 {
		c.encipher(lr, 0)
		c.S[i] = lr[0]
		c.S[i+1] = lr[1]
	}
}
523926
func (s *GroupDefinition) SetKey(v string) *GroupDefinition {
	s.Key = &v
	return s
}
246305
func (k *Keyring) RemoveKey(key []byte) error {
	if bytes.Equal(key, k.keys[0]) {
		return fmt.Errorf("Removing the primary key is not allowed")
	}
	for i, installedKey := range k.keys {
		if bytes.Equal(key, installedKey) {
			keys := append(k.keys[:i], k.keys[i+1:]...)
			k.installKeys(keys, k.keys[0])
		}
	}
	return nil
}
1020240
func (s *ConfigurationTag) SetKey(v string) *ConfigurationTag {
	s.Key = &v
	return s
}
1088948
func (cs *CryptoService) RemoveKey(keyID string) (err error) {
	for _, ks := range cs.keyStores {
		ks.RemoveKey(keyID)
	}
	return // returns whatever the final values were
}
1000914
func (x *XC) decryptPrivateKey(ctx context.Context, recp *keyring.PrivateKey) error {
	fp := recp.Fingerprint()

	for i := 0; i < maxUnlockAttempts; i++ {
		// retry asking for key in case it's wrong
		passphrase, err := x.client.Passphrase(ctx, fp, fmt.Sprintf("Unlock private key %s", recp.Fingerprint()))
		if err != nil {
			return errors.Wrapf(err, "failed to get passphrase from agent: %s", err)
		}

		if err = recp.Decrypt(passphrase); err == nil {
			// passphrase is correct, the key should now be decrypted
			return nil
		}

		// decryption failed, clear cache and wait a moment before trying again
		if err := x.client.Remove(ctx, fp); err != nil {
			return errors.Wrapf(err, "failed to clear cache")
		}
		time.Sleep(10 * time.Millisecond)
	}

	return fmt.Errorf("failed to unlock private key '%s' after %d retries", fp, maxUnlockAttempts)
}
509910
func (s *PatchOrchestratorFilter) SetKey(v string) *PatchOrchestratorFilter {
	s.Key = &v
	return s
}
1081792
func (s *Encryption) SetKey(v string) *Encryption {
	s.Key = &v
	return s
}
580569
func barcodeKey(bcode barcode.Barcode) string {
	return bcode.Metadata().CodeKind + bcode.Content()
}
23393
func Key(ip net.IP) [16]byte {
	var array [16]byte

	if len(ip) == net.IPv4len {
		copy(array[:], v4InV6Prefix)
		copy(array[12:], ip)
	} else {
		copy(array[:], ip)
	}
	return array
}
237935
func (s *MapFilter) SetKey(v string) *MapFilter {
	s.Key = &v
	return s
}
692263
func (p EventKey) RRSetKey() RRSetKey {
	return RRSetKey{
		Zone: p.Zone,
		Type: p.Type,
		Name: p.Name,
	}
}
1076909
func (_m *API) ResetHostKey(_a0 string) ([]byte, error) {
	ret := _m.Called(_a0)

	var r0 []byte
	if rf, ok := ret.Get(0).(func(string) []byte); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]byte)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
836923
func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput {
	s.Key = &v
	return s
}
190721
func (s *S3Source) SetKey(v string) *S3Source {
	s.Key = &v
	return s
}