Module Expr Str Import alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Return NameLoad If BoolOpAnd NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str Str body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num If UnaryOpNot NameLoad body Assign NameStore Str If UnaryOpNot NameLoad body Assign NameStore Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad orelse If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assert CompareGtE AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Slice AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Str Str Str Num NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num If BoolOpAnd NameLoad CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str If BoolOpAnd NameLoad CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad IfExp NameLoad Call NameLoad NameLoad Num NameLoad Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad orelse If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad NameLoad If CompareEq NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad orelse If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If CompareNotEq NameLoad Num body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad ImportFrom alias Expr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore ListLoad Str Str Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Call NameLoad Call NameLoad NameLoad NameLoad Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Num Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore ListLoad Str Str Str Str Str Str Str body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Call NameLoad Call NameLoad NameLoad NameLoad Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore ListLoad TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore ListLoad TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore ListLoad TupleLoad Str AttributeLoad NameLoad attr TupleLoad Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad
N/A N/A 
Wrapper for the core Keychain API

Most of the internals are directly based on the native Keychain API. Apple's developer documentation is highly relevant:

http://developer.apple.com/documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898-CH1-SW1
 N/A os N/A ctypes PyMacAdmin Security Keychain N/A object N/A N/A A friendlier wrapper for the Keychain API __init__ N/A N/A self keychain_name N/A None N/A N/A N/A self keychain_handle N/A N/A self open_keychain keychain_name N/A open_keychain N/A N/A self path N/A None N/A N/A Open a keychain file - if no path is provided, the user's default keychain will be used N/A N/A path N/A N/A None N/A N/A path N/A N/A N/A N/A os path exists path N/A N/A N/A IOError N/A Keychain %s does not exist path N/A keychain N/A N/A ctypes c_void_p N/A keychain_ptr N/A N/A ctypes pointer keychain N/A rc N/A N/A N/A Security lib SecKeychainOpen path keychain_ptr N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Couldn't open system keychain: rc=%d rc N/A keychain N/A find_generic_password N/A N/A self service_name account_name N/A N/A N/A Pythonic wrapper for SecKeychainFindGenericPassword N/A item_p N/A N/A ctypes c_uint32 N/A password_length N/A N/A ctypes c_uint32 0 N/A password_data N/A N/A ctypes c_char_p 256 N/A N/A service_name N/A N/A service_name N/A N/A account_name N/A N/A account_name N/A rc N/A N/A N/A Security lib SecKeychainFindGenericPassword N/A self keychain_handle N/A len service_name service_name N/A len account_name account_name N/A N/A ctypes byref password_length N/A N/A ctypes pointer password_data N/A N/A ctypes byref item_p N/A N/A rc -25300 N/A N/A N/A KeyError N/A No keychain entry for generic password: service=%s, account=%s N/A service_name account_name N/A N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Unable to retrieve generic password (service=%s, account=%s): rc=%d N/A service_name account_name rc N/A password N/A N/A password_data value N/A 0 N/A password_length value N/A N/A N/A N/A Security lib SecKeychainItemFreeContent None password_data N/A info N/A SecKeychainAttributeInfo N/A attrs_p N/A SecKeychainAttributeList_p N/A N/A info count 1 N/A N/A N/A info tag contents N/A Security kSecLabelItemAttr N/A N/A N/A N/A Security lib SecKeychainItemCopyAttributesAndData item_p N/A N/A ctypes pointer info None N/A N/A ctypes byref attrs_p None None N/A attrs N/A attrs_p contents N/A N/A N/A attrs count 1 N/A label N/A N/A N/A N/A attrs attr N/A 0 data N/A N/A N/A N/A attrs attr N/A 0 length N/A N/A N/A N/A Security lib SecKeychainItemFreeAttributesAndData attrs_p N/A N/A GenericPassword service_name service_name account_name account_name password password keychain_item item_p label label N/A find_internet_password N/A N/A self account_name password server_name security_domain path port protocol_type authentication_type N/A 0 None None N/A N/A Pythonic wrapper for SecKeychainFindInternetPassword N/A item N/A N/A ctypes c_void_p N/A password_length N/A N/A ctypes c_uint32 0 N/A password_data N/A N/A ctypes c_char_p 256 N/A N/A protocol_type N/A N/A len protocol_type 4 N/A N/A N/A TypeError protocol_type must be a valid FourCharCode - see http://developer.apple.com/documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/c_ref/SecProtocolType N/A N/A authentication_type N/A N/A len authentication_type 4 N/A N/A N/A TypeError authentication_type must be a valid FourCharCode - see http://developer.apple.com/documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/c_ref/SecAuthenticationType N/A N/A N/A isinstance port int N/A N/A port N/A int port N/A rc N/A N/A N/A Security lib SecKeychainFindInternetPassword N/A self keychain_handle N/A len server_name server_name N/A security_domain N/A len security_domain 0 security_domain N/A len account_name account_name N/A len path path port protocol_type authentication_type N/A N/A ctypes byref password_length N/A N/A ctypes pointer password_data N/A N/A ctypes pointer item N/A N/A rc -25300 N/A N/A N/A KeyError N/A No keychain entry for internet password: server=%s, account=%s N/A server_name account_name N/A N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Unable to retrieve internet password (server=%s, account=%s): rc=%d N/A server_name account_name rc N/A password N/A N/A password_data value N/A 0 N/A password_length value N/A N/A N/A N/A Security lib SecKeychainItemFreeContent None password_data N/A N/A InternetPassword server_name server_name account_name account_name password password keychain_item item security_domain security_domain path path port port protocol_type protocol_type authentication_type authentication_type N/A add N/A N/A self item N/A N/A N/A Add the provided GenericPassword or InternetPassword object to this Keychain N/A N/A isinstance item GenericPassword N/A item_ref N/A N/A ctypes c_void_p N/A N/A isinstance item InternetPassword N/A N/A rc N/A N/A N/A Security lib SecKeychainAddInternetPassword N/A self keychain_handle N/A len N/A item server_name N/A item server_name N/A len N/A item security_domain N/A item security_domain N/A len N/A item account_name N/A item account_name N/A len N/A item path N/A item path N/A item port N/A item protocol_type N/A item authentication_type N/A len N/A item password N/A item password N/A N/A ctypes pointer item_ref N/A N/A rc N/A N/A N/A Security lib SecKeychainAddGenericPassword N/A self keychain_handle N/A len N/A item service_name N/A item service_name N/A len N/A item account_name N/A item account_name N/A len N/A item password N/A item password N/A N/A ctypes pointer item_ref N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Error adding %s: rc=%d N/A item rc N/A N/A item keychain_item item_ref N/A remove N/A N/A self item N/A N/A N/A Remove the provided keychain item as the reverse of Keychain.add() N/A N/A isinstance item GenericPassword N/A N/A N/A item delete N/A N/A GenericPassword N/A object N/A N/A Generic keychain password used with SecKeychainAddGenericPassword and SecKeychainFindGenericPassword N/A account_name None N/A service_name None N/A label None N/A password None N/A keychain_item None __init__ N/A N/A self N/A kwargs N/A N/A N/A N/A N/A super GenericPassword self __init__ N/A N/A k v N/A N/A kwargs items N/A N/A N/A N/A hasattr self k N/A N/A N/A AttributeError N/A Unknown property %s k N/A N/A setattr self k v N/A update_password N/A N/A self new_password N/A N/A N/A Change the stored password N/A rc N/A N/A N/A Security lib SecKeychainItemModifyAttributesAndData N/A self keychain_item None N/A len new_password new_password N/A N/A rc -61 N/A N/A N/A RuntimeError N/A Permission denied updating %s self N/A N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Unable to update password for %s: rc = %d rc N/A delete N/A N/A self N/A N/A N/A Removes this item from the keychain N/A rc N/A N/A N/A Security lib SecKeychainItemDelete N/A self keychain_item N/A N/A rc 0 N/A N/A N/A RuntimeError N/A Unable to delete %s: rc=%d N/A self rc CoreFoundation CFRelease N/A N/A CFRelease N/A self keychain_item N/A N/A self keychain_item None N/A N/A self service_name None N/A N/A self account_name None N/A N/A self password None N/A __str__ N/A N/A self N/A N/A N/A N/A repr self N/A __repr__ N/A N/A self N/A N/A N/A props N/A N/A k N/A service_name account_name label N/A N/A N/A N/A props append N/A %s=%s N/A k N/A repr N/A getattr self k N/A N/A %s(%s) N/A N/A N/A self __class__ __name__ N/A N/A ,  join props N/A N/A InternetPassword N/A GenericPassword N/A N/A Specialized keychain item for internet passwords used with SecKeychainAddInternetPassword and SecKeychainFindInternetPassword N/A account_name N/A password None N/A keychain_item None N/A server_name N/A security_domain N/A path N/A port 0 N/A protocol_type None N/A authentication_type None __init__ N/A N/A self N/A kwargs N/A N/A N/A N/A N/A super InternetPassword self __init__ kwargs N/A __repr__ N/A N/A self N/A N/A N/A props N/A N/A k N/A account_name server_name security_domain path port protocol_type authentication_type N/A N/A N/A getattr self k N/A N/A N/A N/A props append N/A %s=%s N/A k N/A repr N/A getattr self k N/A N/A %s(%s) N/A N/A N/A self __class__ __name__ N/A N/A ,  join props N/A N/A SecKeychainAttribute N/A N/A ctypes Structure N/A N/A Contains keychain attributes

    tag:    A 4-byte attribute tag.
    length: The length of the buffer pointed to by data.
    data:   A pointer to the attribute data.
     N/A _fields_ N/A N/A tag N/A ctypes c_uint32 N/A length N/A ctypes c_uint32 N/A data N/A ctypes c_char_p N/A SecKeychainAttributeList N/A N/A ctypes Structure N/A N/A Represents a list of keychain attributes

    count:  An unsigned 32-bit integer that represents the number of keychain attributes in the array.
    attr:   A pointer to the first keychain attribute in the array.
     N/A _fields_ N/A N/A count N/A ctypes c_uint N/A attr N/A N/A ctypes POINTER SecKeychainAttribute N/A SecKeychainAttributeInfo N/A N/A ctypes Structure N/A N/A Represents a keychain attribute as a pair of tag and format values.

    count:  The number of tag-format pairs in the respective arrays
    tag:    A pointer to the first attribute tag in the array
    format: A pointer to the first CSSM_DB_ATTRIBUTE_FORMAT in the array
     N/A _fields_ N/A N/A count N/A ctypes c_uint N/A tag N/A N/A ctypes POINTER N/A ctypes c_uint N/A format N/A N/A ctypes POINTER N/A ctypes c_uint N/A N/A SecKeychainAttributeInfo_p N/A N/A ctypes POINTER SecKeychainAttributeInfo N/A SecKeychainAttributeList_p N/A N/A ctypes POINTER SecKeychainAttributeList