2  * Copyright (c) 2000-2004,2006,2011,2014 Apple Inc. All Rights Reserved. 
   4  * @APPLE_LICENSE_HEADER_START@ 
   6  * This file contains Original Code and/or Modifications of Original Code 
   7  * as defined in and that are subject to the Apple Public Source License 
   8  * Version 2.0 (the 'License'). You may not use this file except in 
   9  * compliance with the License. Please obtain a copy of the License at 
  10  * http://www.opensource.apple.com/apsl/ and read it before using this 
  13  * The Original Code and all software distributed under the License are 
  14  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  15  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  16  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 
  17  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  18  * Please see the License for the specific language governing rights and 
  19  * limitations under the License. 
  21  * @APPLE_LICENSE_HEADER_END@ 
  26 // ssnotify - constants for Security notifications 
  28 // This interface is private to the Security system. It is not a public interface, 
  29 // and it may change at any time. You have been warned. 
  35 #include <Security/cssm.h> 
  38 namespace SecurityServer 
{ 
  44 typedef uint32 NotificationDomain
;  // message domain (group) 
  45 typedef uint32 NotificationEvent
;   // event number (within a domain) 
  46 typedef uint32 NotificationMask
;        // mask of events (containing 1 << event number) 
  50 // Values for notification domains. 
  53         kNotificationDomainAll                  
= 0, // all domains (useful for testing only) 
  54         kNotificationDomainDatabase             
= 1, // something happened to a database (aka keychain) 
  55         kNotificationDomainPCSC                 
= 2, // pcscd-generated events 
  56         kNotificationDomainCDSA                 
= 3  // CDSA-layer events (for plugins) 
  61 // Event codes are separate per domain, with a maximum of 32 event codes 
  62 // per domain (0-31) so they fit into a uint32 mask set. For each domain, 
  63 // this constant will thus select all possible events for that domain: 
  66         kNotificationAllEvents                  
= uint32(-1)    // mask of all events 
  71 // Notification events for kNotificationDomainDatabase. 
  72 // These are public events (vended through the "keychain notifications" API), 
  73 // and the event numbers must match the public API. 
  74 // The constants below only describe the subset of this domain whose events 
  75 // are generated directly by securityd. The full complement is in 
  76 // <Security/SecKeychain.h>, including those generated by clients for other 
  80         kNotificationEventLocked                        
= 1,    // a keychain was locked 
  81         kNotificationEventUnlocked                      
= 2,    // a keychain was unlocked 
  82         kNotificationEventPassphraseChanged 
= 6         // a keychain password was (possibly) changed 
  87 // PCSC-related notifications. 
  88 // These are generated by the PCSC daemon (pcscd), and are generally only 
  89 // (directly) listened to by securityd, though they may be useful for other 
  90 // programs that want to know when smart-card state is changing. This is 
  91 // an Apple-specific feature of pcscd. 
  94         kNotificationPCSCStateChange            
= 1,            // general PCSC state change 
  95         kNotificationPCSCInitialized            
= 2                     // pcscd has just started up 
 100 // CDSA-related notifications. 
 101 // These are generated by securityd, and are listened to by CDSA plugins 
 102 // that need to generate CDSA-layer event notifications. This feature is 
 103 // internal to Apple's smart-card support architecture; the official (CDSA) 
 104 // standard events are sent by the plugins to CSSM (as a result of receiving 
 108         kNotificationCDSAInsertion                      
= 1,    // CDSA insertion event 
 109         kNotificationCDSARemoval                        
= 2,    // CDSA removal event 
 110         kNotificationCDSAFailure                        
= 3             // CDSA failure event 
 114 } // end namespace SecurityServer 
 115 } // end namespace Security