 
 import Foundation
 
-protocol Key {
-    
-    var accessibility: Accessibility { get set }
+protocol KeyProtocol {
+    
+    var accessibility: CFStringRef { get set }
     var accessGroup: CFStringRef { get set }
     init(attributes: Dictionary<String, Any>)
 }
 
-public struct GenericKey: Key {
-    
-    private var _accessibility:     Accessibility!
+public class Key {
+    
+    private var _accessibility:     CFStringRef!
+    private var _isInvisible:       CFBooleanRef!
+    
+    public init(attributes: Dictionary<String, Any>) {
+        
+        _accessibility   = kSecAttrAccessibleWhenUnlocked
+        _isInvisible     = kCFBooleanFalse
+    }
+}
+
+public class GenericKey: Key, KeyProtocol {
+    
     private var _accessGroup:       CFStringRef!
     private var _creationDate:      CFDateRef!
     private var _modificationDate:  CFDateRef!

        }
    }
    
    public init(attributes: Dictionary<String, Any>) {
        accessibility   = .WhenUnlocked
        isInvisible     = kCFBooleanFalse
    }
    
    /*
    kSecAttrAccessible
    kSecAttrAccessGroup
    kSecAttrCreationDate
    kSecAttrModificationDate
    kSecAttrDescription
    kSecAttrComment
    kSecAttrCreator
    kSecAttrType
    kSecAttrLabel
    kSecAttrIsInvisible
    kSecAttrIsNegative
    kSecAttrAccount
    kSecAttrService
    kSecAttrGeneric
    */
}


public struct InternetKey: Key {
    
    var accessibility: Accessibility {
        get {
            return self.accessibility
        }
        set(newValue) {
            self.accessibility = newValue
        }
    }
    

    private var _creator:           CFNumberRef!
    private var _type:              CFNumberRef!
    private var _label:             CFStringRef!
    private var _isNegative:        CFBooleanRef!
    private var _account:           CFStringRef!
    private var _service:           CFStringRef!
    private var _generic:           CFDataRef!
    
    var accessibility: CFStringRef {
        get {
            return _accessibility
        }
