diff --git a/acceptance/15-list-keypairs.go b/acceptance/15-list-keypairs.go
new file mode 100644
index 0000000..9b137f4
--- /dev/null
+++ b/acceptance/15-list-keypairs.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+	"flag"
+	"fmt"
+	"github.com/rackspace/gophercloud"
+)
+
+var quiet = flag.Bool("quiet", false, "Quiet mode for acceptance testing.  $? non-zero on error though.")
+var rgn = flag.String("r", "DFW", "Datacenter region to interrogate.")
+
+func main() {
+	flag.Parse()
+
+	withIdentity(false, func(auth gophercloud.AccessProvider) {
+		withServerApi(auth, func(servers gophercloud.CloudServersProvider) {
+			keypairs, err := servers.ListKeyPairs()
+			if err != nil {
+				panic(err)
+			}
+
+			if !*quiet {
+				fmt.Println("name,fingerprint,publickey")
+				for _, key := range keypairs {
+					fmt.Printf("%s,%s,%s\n", key.Name, key.FingerPrint, key.PublicKey)
+				}
+			}
+		})
+	})
+}
diff --git a/acceptance/16-create-delete-keypair.go b/acceptance/16-create-delete-keypair.go
new file mode 100644
index 0000000..efba4cf
--- /dev/null
+++ b/acceptance/16-create-delete-keypair.go
@@ -0,0 +1,43 @@
+package main
+
+import (
+	"flag"
+	"fmt"
+	"github.com/rackspace/gophercloud"
+)
+
+var quiet = flag.Bool("quiet", false, "Quiet mode for acceptance testing.  $? non-zero on error though.")
+var rgn = flag.String("r", "DFW", "Datacenter region to interrogate.")
+
+func main() {
+	flag.Parse()
+
+	withIdentity(false, func(auth gophercloud.AccessProvider) {
+		withServerApi(auth, func(servers gophercloud.CloudServersProvider) {
+			name := randomString("ACPTTEST", 16)
+			kp := gophercloud.NewKeyPair{
+				Name: name,
+			}
+			keypair, err := servers.CreateKeyPair(kp)
+			if err != nil {
+				panic(err)
+			}
+			if !*quiet {
+				fmt.Printf("%s,%s,%s\n", keypair.Name, keypair.FingerPrint, keypair.PublicKey)
+			}
+
+			keypair, err = servers.ShowKeyPair(name)
+			if err != nil {
+				panic(err)
+			}
+			if !*quiet {
+				fmt.Printf("%s,%s,%s\n", keypair.Name, keypair.FingerPrint, keypair.PublicKey)
+			}
+
+			err = servers.DeleteKeyPair(name)
+			if err != nil {
+				panic(err)
+			}
+		})
+	})
+}
diff --git a/interfaces.go b/interfaces.go
index c986fce..725b602 100644
--- a/interfaces.go
+++ b/interfaces.go
@@ -147,4 +147,18 @@
 	// ListFlavors yields the list of available system flavors.  This function
 	// returns full details for each flavor, if available.
 	ListFlavors() ([]Flavor, error)
+
+	// KeyPairs
+
+	// ListKeyPairs yields the list of available keypairs.
+	ListKeyPairs() ([]KeyPair, error)
+
+	// CreateKeyPairs will create or generate a new keypair.
+	CreateKeyPair(nkp NewKeyPair) (KeyPair, error)
+
+	// DeleteKeyPair wil delete a keypair.
+	DeleteKeyPair(name string) error
+
+	// ShowKeyPair will yield the named keypair.
+	ShowKeyPair(name string) (KeyPair, error)
 }
diff --git a/keypairs.go b/keypairs.go
new file mode 100644
index 0000000..37bd456
--- /dev/null
+++ b/keypairs.go
@@ -0,0 +1,96 @@
+package gophercloud
+
+import (
+	"github.com/racker/perigee"
+)
+
+// See the CloudImagesProvider interface for details.
+func (gsp *genericServersProvider) ListKeyPairs() ([]KeyPair, error) {
+	type KeyPairs struct {
+		KeyPairs []struct {
+			KeyPair KeyPair `json:"keypair"`
+		} `json:"keypairs"`
+	}
+
+	var kp KeyPairs
+
+	err := gsp.context.WithReauth(gsp.access, func() error {
+		url := gsp.endpoint + "/os-keypairs"
+		return perigee.Get(url, perigee.Options{
+			CustomClient: gsp.context.httpClient,
+			Results:      &kp,
+			MoreHeaders: map[string]string{
+				"X-Auth-Token": gsp.access.AuthToken(),
+			},
+		})
+	})
+
+	// Flatten out the list of keypairs
+	var keypairs []KeyPair
+	for _, k := range kp.KeyPairs {
+		keypairs = append(keypairs, k.KeyPair)
+	}
+	return keypairs, err
+}
+
+func (gsp *genericServersProvider) CreateKeyPair(nkp NewKeyPair) (KeyPair, error) {
+	var kp KeyPair
+
+	err := gsp.context.WithReauth(gsp.access, func() error {
+		url := gsp.endpoint + "/os-keypairs"
+		return perigee.Post(url, perigee.Options{
+			ReqBody: &struct {
+				KeyPair *NewKeyPair `json:"keypair"`
+			}{&nkp},
+			CustomClient: gsp.context.httpClient,
+			Results:      &struct{ KeyPair *KeyPair }{&kp},
+			MoreHeaders: map[string]string{
+				"X-Auth-Token": gsp.access.AuthToken(),
+			},
+		})
+	})
+	return kp, err
+}
+
+// See the CloudImagesProvider interface for details.
+func (gsp *genericServersProvider) DeleteKeyPair(name string) error {
+	err := gsp.context.WithReauth(gsp.access, func() error {
+		url := gsp.endpoint + "/os-keypairs/" + name
+		return perigee.Delete(url, perigee.Options{
+			CustomClient: gsp.context.httpClient,
+			MoreHeaders: map[string]string{
+				"X-Auth-Token": gsp.access.AuthToken(),
+			},
+			OkCodes: []int{202},
+		})
+	})
+	return err
+}
+
+func (gsp *genericServersProvider) ShowKeyPair(name string) (KeyPair, error) {
+	var kp KeyPair
+
+	err := gsp.context.WithReauth(gsp.access, func() error {
+		url := gsp.endpoint + "/os-keypairs/" + name
+		return perigee.Get(url, perigee.Options{
+			CustomClient: gsp.context.httpClient,
+			Results:      &struct{ KeyPair *KeyPair }{&kp},
+			MoreHeaders: map[string]string{
+				"X-Auth-Token": gsp.access.AuthToken(),
+			},
+		})
+	})
+	return kp, err
+}
+
+type KeyPair struct {
+	FingerPrint string `json:"fingerprint"`
+	Name        string `json:"name"`
+	PublicKey   string `json:"public_key"`
+	UserID      string `json:"user_id,omitempty"`
+}
+
+type NewKeyPair struct {
+	Name      string `json:"name"`
+	PublicKey string `json:"public_key,omitempty"`
+}
