// SetKeyPair sets the KeyPair field's value.
762250
func (s *Server) SetKeyPair(v string) *Server {
	s.KeyPair = &v
	return s
}
1021382
func (s *RevokeGrantInput) SetKeyId(v string) *RevokeGrantInput {
	s.KeyId = &v
	return s
}
1017037
func (k *Kontrol) KeyPair() (pair *KeyPair, err error) {
	if k.selfKeyPair != nil {
		return k.selfKeyPair, nil
	}

	kiteKey := k.Kite.KiteKey()

	if kiteKey == "" || len(k.lastPublic) == 0 {
		return nil, errNoSelfKeyPair
	}

	keyIndex := -1

	me := new(multiError)

	for i := range k.lastPublic {
		ri := len(k.lastPublic) - i - 1

		keyFn := func(token *jwt.Token) (interface{}, error) {
			if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
				return nil, errors.New("invalid signing method")
			}

			return jwt.ParseRSAPublicKeyFromPEM([]byte(k.lastPublic[ri]))
		}

		if _, err := jwt.ParseWithClaims(kiteKey, &kitekey.KiteClaims{}, keyFn); err != nil {
			me.err = append(me.err, err)
			continue
		}

		keyIndex = ri
		break
	}

	if keyIndex == -1 {
		return nil, fmt.Errorf("no matching self key pair found: %s", me)
	}

	k.selfKeyPair = &KeyPair{
		ID:      k.lastIDs[keyIndex],
		Public:  k.lastPublic[keyIndex],
		Private: k.lastPrivate[keyIndex],
	}

	return k.selfKeyPair, nil
}
1301115
func (s *JobOutput) SetKey(v string) *JobOutput {
	s.Key = &v
	return s
}
516556
func (s *ObjectVersion) SetKey(v string) *ObjectVersion {
	s.Key = &v
	return s
}
829457
func (s *RecordTag) SetKey(v string) *RecordTag {
	s.Key = &v
	return s
}
152902
func (s *CreateInstancesInput) SetKeyPairName(v string) *CreateInstancesInput {
	s.KeyPairName = &v
	return s
}
10332
func (s *PutParameterInput) SetKeyId(v string) *PutParameterInput {
	s.KeyId = &v
	return s
}
1315024
func (vm *VM) SetKeyPair(privateKey string, name string) {
	vm.SSHCreds.SSHPrivateKey = privateKey
	vm.KeyPair = name
}
984595
func (s *JobInput) SetKey(v string) *JobInput {
	s.Key = &v
	return s
}
663638
func (client *Client) CreateKeyPair(args *CreateKeyPairArgs) (resp *CreateKeyPairResponse, err error) {
	response := CreateKeyPairResponse{}
	err = client.Invoke("CreateKeyPair", args, &response)
	if err != nil {
		return nil, err
	}
	return &response, err
}
941702
func (s *Backup) SetKeyPair(v string) *Backup {
	s.KeyPair = &v
	return s
}
948296
func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata {
	s.KeyManager = &v
	return s
}
685194
func (s *StreamDescriptionSummary) SetKeyId(v string) *StreamDescriptionSummary {
	s.KeyId = &v
	return s
}
627525
func (s *UntagResourceInput) SetKeyId(v string) *UntagResourceInput {
	s.KeyId = &v
	return s
}
1161054
func (s *KeyPair) SetPrivateKey(v string) *KeyPair {
	s.PrivateKey = &v
	return s
}
767930
func (s *GetUsagePlansInput) SetKeyId(v string) *GetUsagePlansInput {
	s.KeyId = &v
	return s
}