Index: src/encryptdb/kmip_request.cpp
diff --git a/src/encryptdb/kmip_request.cpp b/src/encryptdb/kmip_request.cpp
index 40332a67bdb3b011d94321dc9968e286227851b6..abc6a95c86020fa3c38713e5ae3f1de81e0d8fb3 100644
--- a/src/encryptdb/kmip_request.cpp
+++ b/src/encryptdb/kmip_request.cpp
@@ -124,7 +124,8 @@ std::vector<uint8_t> encodeCreatePayload(const CreateKMIPRequestParameters& requ
     return payload;
 }
 
-std::vector<uint8_t> encodeStringTag(const std::array<uint8_t, 3> tag, std::vector<uint8_t> value) {
+std::vector<uint8_t> encodeTaggedString(const std::array<uint8_t, 3> tag,
+                                        std::vector<uint8_t> value) {
     std::vector<uint8_t> payload;
 
     std::vector<uint8_t> paddedValue = padToEightByteMultiple(value);
@@ -132,7 +133,6 @@ std::vector<uint8_t> encodeStringTag(const std::array<uint8_t, 3> tag, std::vect
     // For Text Strings, the Item Length is the number of bytes excluding the padding bytes.
     std::vector<uint8_t> valueLen = convertIntToBigEndianArray(value.size());
 
-    // Tag: Unique Identifier, Type: Text String, Size of UUID, UUID
     payload.insert(payload.end(), std::begin(tag), std::end(tag));
     payload.push_back(static_cast<uint8_t>(ItemType::textString));
 
@@ -143,13 +143,14 @@ std::vector<uint8_t> encodeStringTag(const std::array<uint8_t, 3> tag, std::vect
 }
 
 std::vector<uint8_t> encodeGetPayload(const KeyKMIPRequestParameters& requestParams) {
-    return encodeStringTag(uniqueIdentifierTag, requestParams.uid);
+    return encodeTaggedString(uniqueIdentifierTag, requestParams.uid);
 }
 
 std::vector<uint8_t> encodeGetAttributePayload(
     const GetAttributeKMIPRequestParameters& requestParams) {
-    std::vector<uint8_t> payload = encodeStringTag(uniqueIdentifierTag, requestParams.uid);
-    std::vector<uint8_t> typePayload = encodeStringTag(attributeNameTag, requestParams.type);
+    std::vector<uint8_t> payload = encodeTaggedString(uniqueIdentifierTag, requestParams.uid);
+    std::vector<uint8_t> typePayload =
+        encodeTaggedString(attributeNameTag, requestParams.attributeName);
 
     payload.insert(payload.end(), std::begin(typePayload), std::end(typePayload));
     return payload;
@@ -176,7 +177,7 @@ std::vector<uint8_t> encodeOpAndRequestPayload(const KMIPRequestParameters& requ
             encodeCreatePayload(static_cast<const CreateKMIPRequestParameters&>(requestParams));
     } else if (std::memcmp(requestParams.operationType,
                            activateOperationTypeArray,
-                           sizeof(getOperationTypeArray)) == 0 ||
+                           sizeof(activateOperationTypeArray)) == 0 ||
                std::memcmp(requestParams.operationType,
                            getOperationTypeArray,
                            sizeof(getOperationTypeArray)) == 0) {
@@ -189,7 +190,7 @@ std::vector<uint8_t> encodeOpAndRequestPayload(const KMIPRequestParameters& requ
             static_cast<const GetAttributeKMIPRequestParameters&>(requestParams));
     } else if (std::memcmp(requestParams.operationType,
                            discoverVersionsOperationTypeArray,
-                           sizeof(getOperationTypeArray)) == 0) {
+                           sizeof(discoverVersionsOperationTypeArray)) == 0) {
         // Discover Versions has no request payload.
     } else {
         MONGO_UNREACHABLE;
Index: src/encryptdb/kmip_request.h
diff --git a/src/encryptdb/kmip_request.h b/src/encryptdb/kmip_request.h
index 11f3235e071086e740857a8d1f40b1a67e89d851..948ff2a716ff8e5a19dbdd37dafce22bb7fc44dd 100644
--- a/src/encryptdb/kmip_request.h
+++ b/src/encryptdb/kmip_request.h
@@ -54,17 +54,19 @@ struct DiscoverVersionsKMIPRequestParameters : KMIPRequestParameters {
  */
 struct KeyKMIPRequestParameters : KMIPRequestParameters {
     KeyKMIPRequestParameters(OperationType opType, std::vector<uint8_t> u)
-        : KMIPRequestParameters(opType), uid(u) {}
+        : KMIPRequestParameters(opType), uid(std::move(u)) {}
 
     std::vector<uint8_t> uid;
 };
 
 struct GetAttributeKMIPRequestParameters : KMIPRequestParameters {
-    GetAttributeKMIPRequestParameters(std::vector<uint8_t> u, std::vector<uint8_t> type)
-        : KMIPRequestParameters(OperationType::getAttribute), uid(u), type(type) {}
+    GetAttributeKMIPRequestParameters(std::vector<uint8_t> u, std::vector<uint8_t> attributeName)
+        : KMIPRequestParameters(OperationType::getAttribute),
+          uid(std::move(u)),
+          attributeName(std::move(attributeName)) {}
 
     std::vector<uint8_t> uid;
-    std::vector<uint8_t> type;
+    std::vector<uint8_t> attributeName;
 };
 
 /**
Index: src/encryptdb/kmip_request_test.cpp
diff --git a/src/encryptdb/kmip_request_test.cpp b/src/encryptdb/kmip_request_test.cpp
index 187d1b6d26e9bbf9a5ff3e7624fd0ca182f990a0..eb3d2af82384f55af20932538156714f70c5c369 100644
--- a/src/encryptdb/kmip_request_test.cpp
+++ b/src/encryptdb/kmip_request_test.cpp
@@ -8,6 +8,11 @@
 namespace mongo {
 namespace {
 
+const uint8_t uidx[] = {0x34, 0x39, 0x61, 0x31, 0x63, 0x61, 0x38, 0x38, 0x2D, 0x36, 0x62, 0x65,
+                        0x61, 0x2D, 0x34, 0x66, 0x62, 0x32, 0x2D, 0x62, 0x34, 0x35, 0x30, 0x2D,
+                        0x37, 0x65, 0x35, 0x38, 0x38, 0x30, 0x32, 0x63, 0x33, 0x30, 0x33, 0x38};
+std::vector<uint8_t> uid(std::begin(uidx), std::end(uidx));
+
 TEST(KMIPRequestGeneration, CreateSymmetricKey) {
     std::vector<uint8_t> algorithm(std::begin(mongo::kmip::aesCryptoAlgorithm),
                                    std::end(mongo::kmip::aesCryptoAlgorithm));
@@ -46,13 +51,52 @@ TEST(KMIPRequestGeneration, CreateSymmetricKey) {
     ASSERT(createOutput == expectedOutput);
 }
 
-TEST(KMIPRequestGeneration, GetSymmetricKey) {
-    const uint8_t uidx[] = {0x34, 0x39, 0x61, 0x31, 0x63, 0x61, 0x38, 0x38, 0x2D, 0x36, 0x62, 0x65,
-                            0x61, 0x2D, 0x34, 0x66, 0x62, 0x32, 0x2D, 0x62, 0x34, 0x35, 0x30, 0x2D,
-                            0x37, 0x65, 0x35, 0x38, 0x38, 0x30, 0x32, 0x63, 0x33, 0x30, 0x33, 0x38};
-    std::vector<uint8_t> uid(std::begin(uidx), std::end(uidx));
+TEST(KMIPRequestGeneration, Activate) {
+    mongo::kmip::KeyKMIPRequestParameters activateParams(kmip::OperationType::activate, uid);
+    std::vector<uint8_t> activateOutput = mongo::kmip::encodeKMIPRequest(activateParams);
+
+    std::vector<uint8_t> expectedOutput = {
+        0x42, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x90, 0x42, 0x00, 0x77, 0x01, 0x00, 0x00,
+        0x00, 0x38, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x6A, 0x02,
+        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+        0x6B, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x42, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+        0x00, 0x00, 0x42, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x48, 0x42, 0x00, 0x5C, 0x05,
+        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+        0x79, 0x01, 0x00, 0x00, 0x00, 0x30, 0x42, 0x00, 0x94, 0x07, 0x00, 0x00, 0x00, 0x24,
+        0x34, 0x39, 0x61, 0x31, 0x63, 0x61, 0x38, 0x38, 0x2D, 0x36, 0x62, 0x65, 0x61, 0x2D,
+        0x34, 0x66, 0x62, 0x32, 0x2D, 0x62, 0x34, 0x35, 0x30, 0x2D, 0x37, 0x65, 0x35, 0x38,
+        0x38, 0x30, 0x32, 0x63, 0x33, 0x30, 0x33, 0x38, 0x00, 0x00, 0x00, 0x00};
+
+    ASSERT(activateOutput == expectedOutput);
+}
+
+TEST(KMIPRequestGeneration, GetKeyState) {
+    const std::string name = "State";
+    std::vector<uint8_t> attributeName(std::begin(name), std::end(name));
+
+    kmip::GetAttributeKMIPRequestParameters getAttributeParams(uid, attributeName);
+    std::vector<uint8_t> getAttributeOutput = kmip::encodeKMIPRequest(getAttributeParams);
 
-    mongo::kmip::GetKMIPRequestParameters getParams(uid);
+    std::vector<uint8_t> expectedOutput = {
+        0x42, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0xa0, 0x42, 0x00, 0x77, 0x01, 0x00, 0x00,
+        0x00, 0x38, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x6a, 0x02,
+        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+        0x6b, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+        0x42, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+        0x00, 0x00, 0x42, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x58, 0x42, 0x00, 0x5c, 0x05,
+        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+        0x79, 0x01, 0x00, 0x00, 0x00, 0x40, 0x42, 0x00, 0x94, 0x07, 0x00, 0x00, 0x00, 0x24,
+        0x34, 0x39, 0x61, 0x31, 0x63, 0x61, 0x38, 0x38, 0x2d, 0x36, 0x62, 0x65, 0x61, 0x2d,
+        0x34, 0x66, 0x62, 0x32, 0x2d, 0x62, 0x34, 0x35, 0x30, 0x2d, 0x37, 0x65, 0x35, 0x38,
+        0x38, 0x30, 0x32, 0x63, 0x33, 0x30, 0x33, 0x38, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+        0x0a, 0x07, 0x00, 0x00, 0x00, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x00, 0x00, 0x00};
+
+    ASSERT(getAttributeOutput == expectedOutput);
+}
+
+TEST(KMIPRequestGeneration, GetSymmetricKey) {
+    mongo::kmip::KeyKMIPRequestParameters getParams(kmip::OperationType::get, uid);
     std::vector<uint8_t> getOutput = mongo::kmip::encodeKMIPRequest(getParams);
 
     std::vector<uint8_t> expectedOutput = {
Index: src/encryptdb/kmip_response.cpp
diff --git a/src/encryptdb/kmip_response.cpp b/src/encryptdb/kmip_response.cpp
index f56d68610c4e18bf223b902a7ec914e75ae5a440..5b6d2cb7a47e0a3c478dab5ebd3f2b4a732ddcd5 100644
--- a/src/encryptdb/kmip_response.cpp
+++ b/src/encryptdb/kmip_response.cpp
@@ -38,7 +38,7 @@ StatusWith<KMIPResponse> KMIPResponse::create(const char* responseMessage, size_
 KMIPResponse::KMIPResponse() {}
 
 /**
- * Consume a 3 byte tag and compare with the expected input
+ * Consume a tag and compare with the expected input
  * Parse and return the length of the block denoted by the tag
  */
 StatusWith<size_t> KMIPResponse::_parseTag(ConstDataRangeCursor* cdrc,
@@ -66,7 +66,7 @@ StatusWith<size_t> KMIPResponse::_parseTag(ConstDataRangeCursor* cdrc,
         }
         size_t len = swLen.getValue();
 
-        if (memcmp(data, tag.data(), 3) == 0) {
+        if (memcmp(data, tag.data(), tag.size()) == 0) {
             if (data[3] != static_cast<char>(itemType)) {
                 return Status(ErrorCodes::FailedToParse,
                               str::stream() << "Response message was malformed: expected "
@@ -157,14 +157,16 @@ Status KMIPResponse::_parseResponseHeader(ConstDataRangeCursor* cdrc) {
     return Status::OK();
 }
 
-StatusWith<std::string> KMIPResponse::_parseUIDPayload(ConstDataRangeCursor* cdrc,
-                                                       bool expectObjectTypeTag) {
-    if (expectObjectTypeTag) {
-        auto swObjectType =
-            _parseInteger(cdrc, objectTypeTag, ItemType::enumeration, "object type");
-        if (!swObjectType.isOK()) {
-            return swObjectType.getStatus();
-        }
+StatusWith<std::string> KMIPResponse::_parseCreatePayload(ConstDataRangeCursor* cdrc) {
+    auto swObjectType = _parseInteger(cdrc, objectTypeTag, ItemType::enumeration, "object type");
+    if (!swObjectType.isOK()) {
+        return swObjectType.getStatus();
+    }
+    int objectType = swObjectType.getValue();
+    if (objectType != symmetricKeyObjectType) {
+        return Status(ErrorCodes::FailedToParse,
+                      str::stream() << "Expected a symmetric key object type, received "
+                                    << objectType << ".");
     }
     return _parseString(cdrc, uniqueIdentifierTag, "UID");
 }
@@ -289,7 +291,7 @@ Status KMIPResponse::_parseBatchItem(ConstDataRangeCursor* cdrc) {
 
     switch (_opType) {
         case static_cast<uint8_t>(OperationType::create): {
-            StatusWith<std::string> swUID = _parseUIDPayload(cdrc, true);
+            StatusWith<std::string> swUID = _parseCreatePayload(cdrc);
             if (!swUID.isOK()) {
                 return swUID.getStatus();
             }
@@ -297,7 +299,7 @@ Status KMIPResponse::_parseBatchItem(ConstDataRangeCursor* cdrc) {
             break;
         }
         case static_cast<uint8_t>(OperationType::activate): {
-            StatusWith<std::string> swUID = _parseUIDPayload(cdrc, false);
+            StatusWith<std::string> swUID = _parseString(cdrc, uniqueIdentifierTag, "UID");
             if (!swUID.isOK()) {
                 return swUID.getStatus();
             }
@@ -314,6 +316,11 @@ Status KMIPResponse::_parseBatchItem(ConstDataRangeCursor* cdrc) {
             break;
         }
         case static_cast<uint8_t>(OperationType::getAttribute): {
+            auto swUID = _parseString(cdrc, uniqueIdentifierTag, "UID");
+            if (!swUID.isOK()) {
+                return swUID.getStatus();
+            }
+
             return _parseAndStoreKeyAttribute(cdrc);
         }
         default:
@@ -411,11 +418,6 @@ StatusWith<std::uint32_t> KMIPResponse::_parseInteger(ConstDataRangeCursor* cdrc
 }
 
 Status KMIPResponse::_parseAndStoreKeyAttribute(ConstDataRangeCursor* cdrc) {
-    auto swUID = _parseString(cdrc, uniqueIdentifierTag, "UID");
-    if (!swUID.isOK()) {
-        return swUID.getStatus();
-    }
-
     auto swTag = _parseTag(cdrc, attributeTag, ItemType::structure, "attribute");
     if (!swTag.isOK()) {
         return swTag.getStatus();
@@ -426,7 +428,7 @@ Status KMIPResponse::_parseAndStoreKeyAttribute(ConstDataRangeCursor* cdrc) {
         return swAttributeName.getStatus();
     }
 
-    std::string attributeName = swAttributeName.getValue();
+    std::string attributeName = std::move(swAttributeName.getValue());
     if (attributeName != "State") {
         return Status(ErrorCodes::FailedToParse,
                       str::stream() << "Unsupported key attribute type " << attributeName);
Index: src/encryptdb/kmip_response.h
diff --git a/src/encryptdb/kmip_response.h b/src/encryptdb/kmip_response.h
index 29326225a4cd9a761861ff3a247e6ed8f43fab31..5d5cd77e4b6d2e159109cefe587491fc00b9531b 100644
--- a/src/encryptdb/kmip_response.h
+++ b/src/encryptdb/kmip_response.h
@@ -107,7 +107,7 @@ private:
     StatusWith<std::tuple<uint32_t, uint32_t>> _parseProtocolVersion(ConstDataRangeCursor* cdrc);
     StatusWith<time_t> _parseTimeStamp(ConstDataRangeCursor* cdrc);
     Status _parseBatchItem(ConstDataRangeCursor* cdrc);
-    StatusWith<std::string> _parseUIDPayload(ConstDataRangeCursor* cdrc, bool expectObjectTypeTag);
+    StatusWith<std::string> _parseCreatePayload(ConstDataRangeCursor* cdrc);
     StatusWith<std::unique_ptr<SymmetricKey>> _parseSymmetricKeyPayload(ConstDataRangeCursor* cdrc);
     StatusWith<std::string> _parseString(ConstDataRangeCursor* cdrc,
                                          const std::array<uint8_t, 3> tag,
Index: src/encryptdb/kmip_response_test.cpp
diff --git a/src/encryptdb/kmip_response_test.cpp b/src/encryptdb/kmip_response_test.cpp
index 26e907021e05cacf742d875fbb06c86a7e414a29..961fdc7d82a2f80496b6c313666b0005fda2906f 100644
--- a/src/encryptdb/kmip_response_test.cpp
+++ b/src/encryptdb/kmip_response_test.cpp
@@ -10,6 +10,8 @@ namespace {
 
 using namespace mongo::kmip;
 
+// clang-format off
+
 const uint8_t getSymmetricKey[] = {
 /*respMessage*/   0x42,0x00,0x7B,0x01,0x00,0x00,0x01,0x28,
 /*respHeader*/    0x42,0x00,0x7A,0x01,0x00,0x00,0x00,0x48,
@@ -90,7 +92,39 @@ const uint8_t keyNotFound[] = {
                    0x42,0x00,0x7d,0x07,0x00,0x00,0x00,0x09,0x4e,0x4f,0x54,0x5f,0x46,0x4f,0x55,0x4e,
                    0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
 
-const uint8_t getAttributes[] = {
+const uint8_t getKeyState[] = {
+    0x42, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x00, 0xb8, 0x42, 0x00, 0x7a, 0x01, 0x00, 0x00,
+    0x00, 0x48, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x6a, 0x02,
+    0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+    0x6b, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x57, 0x42, 
+    0xc8, 0xbf, 0x42, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 
+    0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x60, 0x42, 0x00, 
+    0x5c, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00,
+    0x42, 0x00, 0x7f, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x42, 0x00, 0x7c, 0x01, 0x00, 0x00, 0x00, 0x38, 0x42, 0x00, 0x94, 0x07,
+    0x00, 0x00, 0x00, 0x04, 0x30, 0x32, 0x2d, 0x36, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+    0x08, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x0a, 0x07, 0x00, 0x00, 0x00, 0x05, 
+    0x53, 0x74, 0x61, 0x74, 0x65, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0b, 0x05, 0x00, 0x00,
+    0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00};
+
+const uint8_t activateKey[] = {
+    0x42, 0x00, 0x7B, 0x01, 0x00, 0x00, 0x00, 0xB0, 0x42, 0x00, 0x7A, 0x01, 0x00, 0x00,
+    0x00, 0x48, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x6A, 0x02,
+    0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
+    0x6B, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x4A, 0xFB,
+    0xED, 0x2B, 0x42, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01,
+    0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x58, 0x42, 0x00,
+    0x5C, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00,
+    0x42, 0x00, 0x7F, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x42, 0x00, 0x7C, 0x01, 0x00, 0x00, 0x00, 0x30, 0x42, 0x00, 0x94, 0x07,
+    0x00, 0x00, 0x00, 0x24, 0x32, 0x31, 0x64, 0x32, 0x38, 0x62, 0x38, 0x61, 0x2D, 0x30,
+    0x36, 0x64, 0x66, 0x2D, 0x34, 0x33, 0x63, 0x30, 0x2D, 0x62, 0x37, 0x32, 0x66, 0x2D,
+    0x32, 0x61, 0x31, 0x36, 0x31, 0x36, 0x33, 0x33, 0x61, 0x64, 0x61, 0x39, 0x00, 0x00, 
+    0x00, 0x00};
+
+const uint8_t getUnsupportedAttribute[] = {
 /*respMessage*/    0x42,0x00,0x7B,0x01,0x00,0x00,0x01,0xB0,
 /*respHeader*/     0x42,0x00,0x7A,0x01,0x00,0x00,0x00,0x48,
   /*protocolVer*/  0x42,0x00,0x69,0x01,0x00,0x00,0x00,0x20,
@@ -133,90 +167,109 @@ const uint8_t incomplete[] = {
   /*timeStamp*/    0x42,0x00,0x92,0x09,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x4A,0xFB,0xE7,0xC6,
   /*batchCount*/   0x42,0x00,0x0D,0x02,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00};
 
-    TEST(KMIPResponseParsing, GetSymmetricKey) {
-        // Get symmetric key response
-        StatusWith<KMIPResponse> swKeyResponse =
-            KMIPResponse::create(reinterpret_cast<const char*>(getSymmetricKey),
-                                 sizeof(getSymmetricKey));
-        ASSERT(swKeyResponse.isOK()) << "Failed to parse getSymmetricKey " <<
-                                          swKeyResponse.getStatus().toString();
-        KMIPResponse r = std::move(swKeyResponse.getValue());
-
-        uint32_t major = std::get<0>(r.getProtocolVersion());
-        uint32_t minor = std::get<1>(r.getProtocolVersion());
-        ASSERT(major == 1 && minor == 0) <<
-            "Unexpected protocol version" << major << "." << minor;
-
-        ASSERT(r.getOpType() == static_cast<uint8_t>(OperationType::get)) <<
-            "Unexpected operation type: " << r.getOpType();
-
-        const std::string expectedUID = "1ed28ea5-2b31-4145-bcf2-36d0756d3890";
-        ASSERT(expectedUID == r.getUID()) << "UID mismatch " << expectedUID << " != " << r.getUID();
-
-        const uint8_t expectedKey[] = { 0xC8,0xE5,0x15,0x23,0xF7,0x3D,0x6E,0xE9,
-                                        0xF4,0x0E,0xAB,0x7C,0xD0,0x68,0x25,0x49,
-                                        0x9D,0x8C,0x0B,0xD0,0x73,0x9E,0x10,0x46 };
-        std::unique_ptr<SymmetricKey> key = r.getSymmetricKey();
-        ASSERT(memcmp(expectedKey, key.get()->getKey(), key.get()->getKeySize()) == 0) <<
-            "Symmetric key mismatch";
-        ASSERT(key.get()->getAlgorithm() == 0x02) << "Algorithm mismatch, expected 0x02, found "
-                                           << key.get()->getAlgorithm();
-        ASSERT(key.get()->getKeySize() == 21) << "Key size mismatch, expexted 21, found "
-                                       << key.get()->getKeySize();
-    }
-
-    TEST(KMIPResponseParsing, DestroyKey) {
-        // Destroy key response
-        StatusWith<KMIPResponse> swDestroyResponse =
-            KMIPResponse::create(reinterpret_cast<const char*>(destroyKey), sizeof(destroyKey));
-        ASSERT(swDestroyResponse.isOK()) << "Failed to parse destroy response" <<
-                                            swDestroyResponse.getStatus().toString();
-
-        KMIPResponse r = std::move(swDestroyResponse.getValue());
-        const std::string expectedUID = "fc8833de-70d2-4ece-b063-fede3a3c59fe";
-        ASSERT(expectedUID == r.getUID()) << "UID mismatch " << expectedUID << " != " << r.getUID();
-    }
-
-    TEST(KMIPResponseParsing, ExtraTags) {
-        // Extra tags
-        StatusWith<KMIPResponse> swExtraTags =
-            KMIPResponse::create(reinterpret_cast<const char*>(extraTags), sizeof(extraTags));
-        ASSERT(swExtraTags.isOK()) << "Failed to parse extraTags response" <<
-                                      swExtraTags.getStatus().toString();
-    }
-
-    TEST(KMIPResponseParsing, KeyNotFound) {
-        StatusWith<KMIPResponse> swResponse =
-            KMIPResponse::create(reinterpret_cast<const char*>(keyNotFound),
-                                 sizeof(keyNotFound));
-        ASSERT(swResponse.isOK()) << "Failed to parse keyNotFound response" <<
-                                     swResponse.getStatus().toString();
-
-        KMIPResponse r = std::move(swResponse.getValue());
-        ASSERT(r.getResultStatus() != kmip::statusSuccess) << "Expected command to fail";
-        ASSERT(r.getResultReason() == 0x01 /* Item not found */) <<
-            "Expected error code 0x01 (Item not found), found: " << r.getResultReason();
-        ASSERT(r.getResultMsg() == "NOT_FOUND") << "Expected result msg \"NOT_FOUND\", found: "
-                                                << r.getResultMsg();
-    }
-
-    TEST(KMIPResponseParsing, NegativeTests) {
-        StatusWith<KMIPResponse> swResponse =
-            KMIPResponse::create(reinterpret_cast<const char*>(getAttributes),
-                                 sizeof(getAttributes));
-
-        ASSERT(swResponse.getStatus().reason() ==
-               "Response message was malformed: unknown operation type 11") <<
-               "Invalid error message for unsupported response getAttributes";
-
-        swResponse = KMIPResponse::create(reinterpret_cast<const char*>(gibberish),
-                                          sizeof(gibberish));
-        ASSERT(!swResponse.isOK()) << "Parsing gibberish did not produce an invalid Status";
-
-        swResponse = KMIPResponse::create(reinterpret_cast<const char*>(incomplete),
-                                          sizeof(incomplete));
-        ASSERT(!swResponse.isOK()) <<
-            "Parsing an incomplete response did not produce an invalid Status";
-    }
+// clang-format on
+
+TEST(KMIPResponseParsing, GetSymmetricKey) {
+    // Get symmetric key response
+    StatusWith<KMIPResponse> swKeyResponse = KMIPResponse::create(
+        reinterpret_cast<const char*>(getSymmetricKey), sizeof(getSymmetricKey));
+    ASSERT(swKeyResponse.isOK()) << "Failed to parse getSymmetricKey "
+                                 << swKeyResponse.getStatus().toString();
+    KMIPResponse r = std::move(swKeyResponse.getValue());
+
+    uint32_t major = std::get<0>(r.getProtocolVersion());
+    uint32_t minor = std::get<1>(r.getProtocolVersion());
+    ASSERT(major == 1 && minor == 0) << "Unexpected protocol version" << major << "." << minor;
+
+    ASSERT(r.getOpType() == static_cast<uint8_t>(OperationType::get))
+        << "Unexpected operation type: " << r.getOpType();
+
+    const std::string expectedUID = "1ed28ea5-2b31-4145-bcf2-36d0756d3890";
+    ASSERT(expectedUID == r.getUID()) << "UID mismatch " << expectedUID << " != " << r.getUID();
+
+    const uint8_t expectedKey[] = {0xC8, 0xE5, 0x15, 0x23, 0xF7, 0x3D, 0x6E, 0xE9,
+                                   0xF4, 0x0E, 0xAB, 0x7C, 0xD0, 0x68, 0x25, 0x49,
+                                   0x9D, 0x8C, 0x0B, 0xD0, 0x73, 0x9E, 0x10, 0x46};
+    std::unique_ptr<SymmetricKey> key = r.getSymmetricKey();
+    ASSERT(memcmp(expectedKey, key.get()->getKey(), key.get()->getKeySize()) == 0)
+        << "Symmetric key mismatch";
+    ASSERT(key.get()->getAlgorithm() == 0x02) << "Algorithm mismatch, expected 0x02, found "
+                                              << key.get()->getAlgorithm();
+    ASSERT(key.get()->getKeySize() == 21) << "Key size mismatch, expexted 21, found "
+                                          << key.get()->getKeySize();
+}
+
+TEST(KMIPResponseParsing, GetKeyState) {
+    // Get key state response
+    StatusWith<KMIPResponse> swGetKeyStateResponse =
+        KMIPResponse::create(reinterpret_cast<const char*>(getKeyState), sizeof(getKeyState));
+    ASSERT(swGetKeyStateResponse.isOK()) << "Failed to parse get key state response"
+                                         << swGetKeyStateResponse.getStatus().toString();
+
+    KMIPResponse r = std::move(swGetKeyStateResponse.getValue());
+    ASSERT(r.getKeyState() == static_cast<uint8_t>(kmip::KeyState::active))
+        << "Invalid key state, should be 'active'.";
+}
+
+TEST(KMIPResponseParsing, ActivateKey) {
+    // Activate key response
+    StatusWith<KMIPResponse> swActivateResponse =
+        KMIPResponse::create(reinterpret_cast<const char*>(activateKey), sizeof(activateKey));
+    ASSERT(swActivateResponse.isOK()) << "Failed to parse activate response"
+                                      << swActivateResponse.getStatus().toString();
+
+    KMIPResponse r = std::move(swActivateResponse.getValue());
+    const std::string expectedUID = "21d28b8a-06df-43c0-b72f-2a161633ada9";
+    ASSERT(expectedUID == r.getUID()) << "UID mismatch " << expectedUID << " != " << r.getUID();
+}
+
+TEST(KMIPResponseParsing, DestroyKey) {
+    // Destroy key response
+    StatusWith<KMIPResponse> swDestroyResponse =
+        KMIPResponse::create(reinterpret_cast<const char*>(destroyKey), sizeof(destroyKey));
+    ASSERT(swDestroyResponse.isOK()) << "Failed to parse destroy response"
+                                     << swDestroyResponse.getStatus().toString();
+
+    KMIPResponse r = std::move(swDestroyResponse.getValue());
+    const std::string expectedUID = "fc8833de-70d2-4ece-b063-fede3a3c59fe";
+    ASSERT(expectedUID == r.getUID()) << "UID mismatch " << expectedUID << " != " << r.getUID();
+}
+
+TEST(KMIPResponseParsing, ExtraTags) {
+    // Extra tags
+    StatusWith<KMIPResponse> swExtraTags =
+        KMIPResponse::create(reinterpret_cast<const char*>(extraTags), sizeof(extraTags));
+    ASSERT(swExtraTags.isOK()) << "Failed to parse extraTags response"
+                               << swExtraTags.getStatus().toString();
+}
+
+TEST(KMIPResponseParsing, KeyNotFound) {
+    StatusWith<KMIPResponse> swResponse =
+        KMIPResponse::create(reinterpret_cast<const char*>(keyNotFound), sizeof(keyNotFound));
+    ASSERT(swResponse.isOK()) << "Failed to parse keyNotFound response"
+                              << swResponse.getStatus().toString();
+
+    KMIPResponse r = std::move(swResponse.getValue());
+    ASSERT(r.getResultStatus() != kmip::statusSuccess) << "Expected command to fail";
+    ASSERT(r.getResultReason() == 0x01 /* Item not found */)
+        << "Expected error code 0x01 (Item not found), found: " << r.getResultReason();
+    ASSERT(r.getResultMsg() == "NOT_FOUND")
+        << "Expected result msg \"NOT_FOUND\", found: " << r.getResultMsg();
+}
+
+TEST(KMIPResponseParsing, NegativeTests) {
+    StatusWith<KMIPResponse> swResponse = KMIPResponse::create(
+        reinterpret_cast<const char*>(getUnsupportedAttribute), sizeof(getUnsupportedAttribute));
+    ASSERT(swResponse.getStatus().reason() == "Unsupported key attribute type Object Group")
+        << "Invalid error message for unsupported response getAttributes";
+
+    swResponse = KMIPResponse::create(reinterpret_cast<const char*>(gibberish), sizeof(gibberish));
+    ASSERT(!swResponse.isOK()) << "Parsing gibberish did not produce an invalid Status";
+
+    swResponse =
+        KMIPResponse::create(reinterpret_cast<const char*>(incomplete), sizeof(incomplete));
+    ASSERT(!swResponse.isOK())
+        << "Parsing an incomplete response did not produce an invalid Status";
+}
 }  // namespace
 }  // namespace mongo
Index: src/encryptdb/kmip_service.cpp
diff --git a/src/encryptdb/kmip_service.cpp b/src/encryptdb/kmip_service.cpp
index b3cc6b0e87a85d89c7f3c64f8cf5350899ca290d..ea4c1d93354f7864074e5b1e68424a417165a631 100644
--- a/src/encryptdb/kmip_service.cpp
+++ b/src/encryptdb/kmip_service.cpp
@@ -39,59 +39,36 @@ KMIPService::KMIPService(const HostAndPort& server, const SSLParams& sslKMIPPara
     }
 }
 
+
 StatusWith<std::string> KMIPService::createExternalKey() {
-    StatusWith<KMIPResponse> swResponse = _sendRequest(_generateKMIPCreateRequest());
+    StatusWith<KMIPResponse> swResponse =
+        _sendRequest(_generateKMIPCreateRequest(), "KMIP create key");
     if (!swResponse.isOK()) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream()
-                          << "KMIP create key failed: " << swResponse.getStatus().reason());
+        return swResponse.getStatus();
     }
-
     KMIPResponse response = std::move(swResponse.getValue());
-    if (response.getResultStatus() != kmip::statusSuccess) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream()
-                          << "KMIP create key failed, code: " << response.getResultReason()
-                          << " error: " << response.getResultMsg());
-    }
-
     const std::string uid = response.getUID();
 
     // Activate the new key
-    swResponse = _sendRequest(_generateKMIPKeyRequest(OperationType::activate, uid));
+    swResponse =
+        _sendRequest(_generateKMIPKeyRequest(OperationType::activate, uid), "KMIP activate key");
     if (!swResponse.isOK()) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream()
-                          << "KMIP activate key failed: " << swResponse.getStatus().reason());
+        return swResponse.getStatus();
     }
 
     response = std::move(swResponse.getValue());
-    if (response.getResultStatus() != kmip::statusSuccess) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream()
-                          << "KMIP activate key failed, code: " << response.getResultReason()
-                          << " error: " << response.getResultMsg());
-    }
-
     return response.getUID();
 }
 
 StatusWith<std::unique_ptr<SymmetricKey>> KMIPService::getExternalKey(const std::string& uid) {
     // Check the status of the key
     StatusWith<KMIPResponse> swResponse =
-        _sendRequest(_generateKMIPGetAttributeRequest(uid, "State"));
+        _sendRequest(_generateKMIPGetAttributeRequest(uid, "State"), "KMIP get key state");
     if (!swResponse.isOK()) {
         return swResponse.getStatus();
     }
 
     KMIPResponse response = std::move(swResponse.getValue());
-    if (response.getResultStatus() != kmip::statusSuccess) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream() << "KMIP get state for key '" << uid
-                                    << "' failed, code: " << response.getResultReason()
-                                    << " error: " << response.getResultMsg());
-    }
-
     switch (response.getKeyState()) {
         case static_cast<uint8_t>(KeyState::preactive):
         case static_cast<uint8_t>(KeyState::active): {
@@ -117,18 +94,11 @@ StatusWith<std::unique_ptr<SymmetricKey>> KMIPService::getExternalKey(const std:
     }
 
     // Retrieve the actual key
-    swResponse = _sendRequest(_generateKMIPKeyRequest(OperationType::get, uid));
+    swResponse = _sendRequest(_generateKMIPKeyRequest(OperationType::get, uid), "KMIP get key");
     if (!swResponse.isOK()) {
         return swResponse.getStatus();
     }
-
     response = std::move(swResponse.getValue());
-    if (response.getResultStatus() != kmip::statusSuccess) {
-        return Status(ErrorCodes::BadValue,
-                      str::stream() << "KMIP get key '" << uid
-                                    << "' failed, code: " << response.getResultReason()
-                                    << " error: " << response.getResultMsg());
-    }
 
     std::unique_ptr<SymmetricKey> key = response.getSymmetricKey();
     if (key->getKeySize() != crypto::sym256KeySize) {
@@ -163,7 +133,8 @@ Status KMIPService::_initServerConnection() {
 }
 
 // Sends a request message to the KMIP server and creates a KMIPResponse.
-StatusWith<KMIPResponse> KMIPService::_sendRequest(const std::vector<uint8_t>& request) {
+StatusWith<KMIPResponse> KMIPService::_sendRequest(const std::vector<uint8_t>& request,
+                                                   const std::string& operation) {
     char resp[2000];
 
     _socket.send(reinterpret_cast<const char*>(request.data()), request.size(), "KMIP request");
@@ -177,8 +148,9 @@ StatusWith<KMIPResponse> KMIPService::_sendRequest(const std::vector<uint8_t>& r
     if (memcmp(resp, kmip::responseMessageTag.data(), 3) != 0 ||
         resp[3] != static_cast<char>(ItemType::structure)) {
         return Status(ErrorCodes::FailedToParse,
-                      "Expected KMIP response message to start with"
-                      "reponse message tag");
+                      str::stream() << operation
+                                    << "failed, expected KMIP response message to start with"
+                                       "reponse message tag");
     }
 
     ConstDataRangeCursor cdrc(resp + 4, resp + 8);
@@ -193,7 +165,20 @@ StatusWith<KMIPResponse> KMIPService::_sendRequest(const std::vector<uint8_t>& r
 
     StatusWith<KMIPResponse> swKMIPResponse = KMIPResponse::create(resp, bodyLength + 8);
     secureZeroMemory(resp, bodyLength + 8);
-    return swKMIPResponse;
+
+    if (!swKMIPResponse.isOK()) {
+        return Status(ErrorCodes::BadValue,
+                      str::stream() << operation
+                                    << " failed: " << swKMIPResponse.getStatus().reason());
+    }
+
+    KMIPResponse response = std::move(swKMIPResponse.getValue());
+    if (response.getResultStatus() != kmip::statusSuccess) {
+        return Status(ErrorCodes::BadValue,
+                      str::stream() << operation << " failed, code: " << response.getResultReason()
+                                    << " error: " << response.getResultMsg());
+    }
+    return std::move(response);
 }
 
 std::vector<uint8_t> KMIPService::_generateKMIPKeyRequest(OperationType opType,
@@ -203,10 +188,10 @@ std::vector<uint8_t> KMIPService::_generateKMIPKeyRequest(OperationType opType,
     return encodeKMIPRequest(keyRequestParams);
 }
 
-std::vector<uint8_t> KMIPService::_generateKMIPGetAttributeRequest(const std::string& uid,
-                                                                   const std::string& type) {
+std::vector<uint8_t> KMIPService::_generateKMIPGetAttributeRequest(
+    const std::string& uid, const std::string& attributeName) {
     std::vector<uint8_t> uuid(std::begin(uid), std::end(uid));
-    std::vector<uint8_t> attribType(std::begin(type), std::end(type));
+    std::vector<uint8_t> attribType(std::begin(attributeName), std::end(attributeName));
     mongo::kmip::GetAttributeKMIPRequestParameters requestParams(uuid, attribType);
     return encodeKMIPRequest(requestParams);
 }
Index: src/encryptdb/kmip_service.h
diff --git a/src/encryptdb/kmip_service.h b/src/encryptdb/kmip_service.h
index 60319812a754f2e8033046e8c9c5c0abe983162f..749e2356a0a84bd38b24d7af8ca336d41991df21 100644
--- a/src/encryptdb/kmip_service.h
+++ b/src/encryptdb/kmip_service.h
@@ -55,12 +55,13 @@ private:
     /**
      * Send a request to the KMIP server.
      */
-    StatusWith<KMIPResponse> _sendRequest(const std::vector<uint8_t>& request);
+    StatusWith<KMIPResponse> _sendRequest(const std::vector<uint8_t>& request,
+                                          const std::string& operation);
 
     std::vector<uint8_t> _generateKMIPKeyRequest(OperationType opType, const std::string& uid);
 
     std::vector<uint8_t> _generateKMIPGetAttributeRequest(const std::string& uid,
-                                                          const std::string& type);
+                                                          const std::string& attributeName);
     std::vector<uint8_t> _generateKMIPCreateRequest();
 
     std::unique_ptr<SSLManagerInterface> _sslManager;
