| Index: crypto/apple_keychain.h
|
| diff --git a/crypto/keychain_mac.h b/crypto/apple_keychain.h
|
| similarity index 92%
|
| rename from crypto/keychain_mac.h
|
| rename to crypto/apple_keychain.h
|
| index bbcf8b1463cdd302f8c5d1c7053c0be65174fe57..840ccee8c2032cc4b3914443d6c1f381eccd703f 100644
|
| --- a/crypto/keychain_mac.h
|
| +++ b/crypto/apple_keychain.h
|
| @@ -10,6 +10,12 @@
|
| #include "base/basictypes.h"
|
| #include "crypto/crypto_export.h"
|
|
|
| +#if defined (OS_IOS)
|
| +typedef void* SecKeychainRef;
|
| +typedef void* SecKeychainItemRef;
|
| +typedef void SecKeychainAttributeList;
|
| +#endif
|
| +
|
| namespace crypto {
|
|
|
| // Wraps the KeychainServices API in a very thin layer, to allow it to be
|
| @@ -20,11 +26,33 @@ namespace crypto {
|
| // SecKeychainFoo). The only exception is Free, which should be used for
|
| // anything returned from this class that would normally be freed with
|
| // CFRelease (to aid in testing).
|
| -class CRYPTO_EXPORT MacKeychain {
|
| +class CRYPTO_EXPORT AppleKeychain {
|
| public:
|
| - MacKeychain();
|
| - virtual ~MacKeychain();
|
| + AppleKeychain();
|
| + virtual ~AppleKeychain();
|
| +
|
| + virtual OSStatus FindGenericPassword(CFTypeRef keychainOrArray,
|
| + UInt32 serviceNameLength,
|
| + const char* serviceName,
|
| + UInt32 accountNameLength,
|
| + const char* accountName,
|
| + UInt32* passwordLength,
|
| + void** passwordData,
|
| + SecKeychainItemRef* itemRef) const;
|
| +
|
| + virtual OSStatus ItemFreeContent(SecKeychainAttributeList* attrList,
|
| + void* data) const;
|
| +
|
| + virtual OSStatus AddGenericPassword(SecKeychainRef keychain,
|
| + UInt32 serviceNameLength,
|
| + const char* serviceName,
|
| + UInt32 accountNameLength,
|
| + const char* accountName,
|
| + UInt32 passwordLength,
|
| + const void* passwordData,
|
| + SecKeychainItemRef* itemRef) const;
|
|
|
| +#if !defined(OS_IOS)
|
| virtual OSStatus ItemCopyAttributesAndData(
|
| SecKeychainItemRef itemRef,
|
| SecKeychainAttributeInfo* info,
|
| @@ -67,32 +95,12 @@ class CRYPTO_EXPORT MacKeychain {
|
| const void* passwordData,
|
| SecKeychainItemRef* itemRef) const;
|
|
|
| - virtual OSStatus FindGenericPassword(CFTypeRef keychainOrArray,
|
| - UInt32 serviceNameLength,
|
| - const char* serviceName,
|
| - UInt32 accountNameLength,
|
| - const char* accountName,
|
| - UInt32* passwordLength,
|
| - void** passwordData,
|
| - SecKeychainItemRef* itemRef) const;
|
| -
|
| - virtual OSStatus ItemFreeContent(SecKeychainAttributeList* attrList,
|
| - void* data) const;
|
| -
|
| - virtual OSStatus AddGenericPassword(SecKeychainRef keychain,
|
| - UInt32 serviceNameLength,
|
| - const char* serviceName,
|
| - UInt32 accountNameLength,
|
| - const char* accountName,
|
| - UInt32 passwordLength,
|
| - const void* passwordData,
|
| - SecKeychainItemRef* itemRef) const;
|
| -
|
| // Calls CFRelease on the given ref, after checking that |ref| is non-NULL.
|
| virtual void Free(CFTypeRef ref) const;
|
| +#endif // !defined(OS_IOS)
|
|
|
| private:
|
| - DISALLOW_COPY_AND_ASSIGN(MacKeychain);
|
| + DISALLOW_COPY_AND_ASSIGN(AppleKeychain);
|
| };
|
|
|
| } // namespace crypto
|
|
|