Handle EC key types in a couple of methods.
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 31 Aug 2010 16:39:56 +0000 (16:39 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 31 Aug 2010 16:39:56 +0000 (16:39 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/branches/REL_1@775 de75baf8-a10c-0410-a50a-987c0e22f00f

xmltooling/security/impl/BasicX509Credential.cpp

index a18cdc4..1a2bbab 100644 (file)
@@ -206,6 +206,11 @@ const char* BasicX509Credential::getAlgorithm() const
             case XSECCryptoKey::KEY_DSA_PAIR:
                 return "DSA";
 
+            case XSECCryptoKey::KEY_EC_PRIVATE:
+            case XSECCryptoKey::KEY_EC_PUBLIC:
+            case XSECCryptoKey::KEY_EC_PAIR:
+                return "EC";
+
             case XSECCryptoKey::KEY_HMAC:
                 return "HMAC";
 
@@ -258,7 +263,7 @@ XSECCryptoKey* BasicX509Credential::getPrivateKey() const
 {
     if (m_key) {
         XSECCryptoKey::KeyType type = m_key->getKeyType();
-        if (type!=XSECCryptoKey::KEY_RSA_PUBLIC && type!=XSECCryptoKey::KEY_DSA_PUBLIC)
+        if (type!=XSECCryptoKey::KEY_RSA_PUBLIC && type!=XSECCryptoKey::KEY_DSA_PUBLIC && type!=XSECCryptoKey::KEY_EC_PUBLIC)
             return m_key;
     }
     return nullptr;
@@ -268,7 +273,7 @@ XSECCryptoKey* BasicX509Credential::getPublicKey() const
 {
     if (m_key) {
         XSECCryptoKey::KeyType type = m_key->getKeyType();
-        if (type!=XSECCryptoKey::KEY_RSA_PRIVATE && type!=XSECCryptoKey::KEY_DSA_PRIVATE)
+        if (type!=XSECCryptoKey::KEY_RSA_PRIVATE && type!=XSECCryptoKey::KEY_DSA_PRIVATE && type!=XSECCryptoKey::KEY_EC_PRIVATE)
             return m_key;
     }
     return nullptr;