summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/network/Credential.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/network/Credential.h')
-rw-r--r--WebCore/platform/network/Credential.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/WebCore/platform/network/Credential.h b/WebCore/platform/network/Credential.h
index 0471fbc..199817c 100644
--- a/WebCore/platform/network/Credential.h
+++ b/WebCore/platform/network/Credential.h
@@ -27,6 +27,13 @@
#include "PlatformString.h"
+#define CERTIFICATE_CREDENTIALS_SUPPORTED ((PLATFORM(MAC) || PLATFORM(IPHONE)) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
+
+#if CERTIFICATE_CREDENTIALS_SUPPORTED
+#include <Security/SecBase.h>
+#include <wtf/RetainPtr.h>
+#endif
+
namespace WebCore {
enum CredentialPersistence {
@@ -34,12 +41,23 @@ enum CredentialPersistence {
CredentialPersistenceForSession,
CredentialPersistencePermanent
};
-
+
+#if CERTIFICATE_CREDENTIALS_SUPPORTED
+enum CredentialType {
+ CredentialTypePassword,
+ CredentialTypeClientCertificate
+};
+#endif
+
class Credential {
public:
Credential();
Credential(const String& user, const String& password, CredentialPersistence);
+ Credential(const Credential& original, CredentialPersistence);
+#if CERTIFICATE_CREDENTIALS_SUPPORTED
+ Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence);
+#endif
bool isEmpty() const;
@@ -48,10 +66,21 @@ public:
bool hasPassword() const;
CredentialPersistence persistence() const;
+#if CERTIFICATE_CREDENTIALS_SUPPORTED
+ SecIdentityRef identity() const;
+ CFArrayRef certificates() const;
+ const CredentialType type() const;
+#endif
+
private:
String m_user;
String m_password;
CredentialPersistence m_persistence;
+#if CERTIFICATE_CREDENTIALS_SUPPORTED
+ RetainPtr<SecIdentityRef> m_identity;
+ RetainPtr<CFArrayRef> m_certificates;
+ CredentialType m_type;
+#endif
};
bool operator==(const Credential& a, const Credential& b);