MBS FileMaker Plugin Example Databases

SmartCard Signatures

All examples are included with download of MBS FileMaker Plugin.

SmartCard Signatures.fmp12

Overview
Tables2
Relationships0
Layouts2
Scripts6
Value Lists2
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
SmartCard
1 field defined, 0 record
SmartCard
Card
9 fields defined, 1 record
Card

Fields

Table Name: SmartCard - 1 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
Reader NameNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German

      Table Name: Card - 9 Fields
      Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
      ReaderNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          StateNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              ProtocolNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  AttributesNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      StateTextNormal, TextAuto-Enter: Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                            CardTypeNormal, TextAuto-Enter:
                            • Allow editing
                            • Do not replace existing value for field (if any)
                            • Context table: Card
                              Calculation: If(Card::Attributes = "3BBF13008131FE45455041"; "ACOS04"; "") & If(Card::Attributes = "3BBF11008131FE45455041"; "ACOS04"; "") & If(Card::Attributes = "3bdf18008131fe588031905241016405c903ac73b7b1d444"; "CARDOS"; "")
                            Validation:
                            • Only during data entry
                            Storage:
                            • Repetitions: 1
                            • Indexing: None
                            • Automatically create indexes as needed
                            • Index Language: German
                                Input for HashNormal, TextAuto-Enter:
                                • Allow editing
                                Validation:
                                • Only during data entry
                                Storage:
                                • Repetitions: 1
                                • Indexing: None
                                • Automatically create indexes as needed
                                • Index Language: German
                                    Signature OutputNormal, TextAuto-Enter:
                                    • Allow editing
                                    Validation:
                                    • Only during data entry
                                    Storage:
                                    • Repetitions: 1
                                    • Indexing: None
                                    • Automatically create indexes as needed
                                    • Index Language: German
                                        CertificateNormal, TextAuto-Enter:
                                        • Allow editing
                                        Validation:
                                        • Only during data entry
                                        Storage:
                                        • Repetitions: 1
                                        • Indexing: None
                                        • Automatically create indexes as needed
                                        • Index Language: German

                                            Layout Objects: SmartCard

                                            Regular Fields

                                            Field Name: SmartCard::Reader Name
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 60 pt
                                            • Left: 112 pt
                                            • Bottom: 81 pt
                                            • Right: 365 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Buttons

                                            Button PropertiesCoordinatesScript/Script Step
                                              Type:
                                            • Text: List SmartCard Readers
                                            • Top: 14 pt
                                            • Left: 56 pt
                                            • Bottom: 43 pt
                                            • Right: 276 pt
                                            • Anchoring: Left, Top
                                            Perform Script [ “Initialize” ]

                                            Scripts:


                                            Button PropertiesCoordinatesScript/Script Step
                                              Type:
                                            • Text: Connect
                                            • Top: 59 pt
                                            • Left: 387 pt
                                            • Bottom: 81 pt
                                            • Right: 508 pt
                                            • Anchoring: Left, Top
                                            Perform Script [ “Connect”; Parameter: SmartCard::Reader Name ]

                                            Scripts:

                                            Fields:


                                            Layout Objects: Card

                                            Regular Fields

                                            Field Name: Card::Reader
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 52 pt
                                            • Left: 138 pt
                                            • Bottom: 73 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::State
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 73 pt
                                            • Left: 138 pt
                                            • Bottom: 94 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::Protocol
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 96 pt
                                            • Left: 138 pt
                                            • Bottom: 117 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::Attributes
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 119 pt
                                            • Left: 138 pt
                                            • Bottom: 140 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::StateText
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 73 pt
                                            • Left: 402 pt
                                            • Bottom: 94 pt
                                            • Right: 630 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Checkbox Set
                                            • Display values from: States
                                            Field Behavior:
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::CardType
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 119 pt
                                            • Left: 402 pt
                                            • Bottom: 140 pt
                                            • Right: 655 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Checkbox Set
                                            • Display values from: CardTypes
                                            Field Behavior:
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::Input for Hash
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 186 pt
                                            • Left: 138 pt
                                            • Bottom: 207 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::Signature Output
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 209 pt
                                            • Left: 138 pt
                                            • Bottom: 230 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Field Name: Card::Certificate
                                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                            • Top: 232 pt
                                            • Left: 138 pt
                                            • Bottom: 401 pt
                                            • Right: 391 pt
                                            • Anchoring: Left, Top
                                            Field Format:
                                            • Edit Box
                                            Field Behavior:
                                            • Allow field to be entered: In Find mode, In Browse mode
                                            • Touch keyboard type: Default for Data Type
                                            • Go to next field using: Tab key
                                            Yes

                                            Buttons

                                            Button PropertiesCoordinatesScript/Script Step
                                              Type:
                                            • Text: Back
                                            • Top: 12 pt
                                            • Left: 12 pt
                                            • Bottom: 34 pt
                                            • Right: 77 pt
                                            • Anchoring: Left, Top
                                            Perform Script [ “Disconnect” ]

                                            Scripts:


                                            Button PropertiesCoordinatesScript/Script Step
                                              Type:
                                            • Text: Read Certificate
                                            • Top: 180 pt
                                            • Left: 438 pt
                                            • Bottom: 207 pt
                                            • Right: 596 pt
                                            • Anchoring: Left, Top
                                            Perform Script [ “ReadCertificate” ]

                                            Scripts:


                                            Button PropertiesCoordinatesScript/Script Step
                                              Type:
                                            • Text: Perform Signature
                                            • Top: 226 pt
                                            • Left: 438 pt
                                            • Bottom: 255 pt
                                            • Right: 596 pt
                                            • Anchoring: Left, Top
                                            Perform Script [ “PerformSignature” ]

                                            Scripts:


                                            Value Lists

                                            Value List NameSourceValuesOn Layouts
                                            StatesCustom
                                            • Present, Removed
                                            CardTypesCustom
                                            • ACOS04, CARDOS

                                            Script Hierarchy

                                            Initialize
                                            Connect
                                            Check Status
                                            Disconnect
                                            ReadCertificate
                                            PerformSignature

                                            Next Script: [Connect]
                                            Script NameInitialize
                                            Run script with full access privilegesOff
                                            Include In MenuYes
                                            Layouts that use this script
                                            Scripts that use this script
                                              Script Definition
                                              Script Steps
                                              • Go to Layout [ “SmartCard” (SmartCard) ]
                                              • Delete All Records [ No dialog ]
                                              • If [ MBS( "SmartCard.Valid"; $$SmartCard ) ]
                                              • #already inited
                                              • Else
                                              • Set Variable [ $$SmartCard; Value:MBS( "SmartCard.Init" ) ]
                                              • End If
                                              • If [ MBS("IsError") ]
                                              • Show Custom Dialog [ Title: "Failed to initialize SmartCard"; Message: $$SmartCard; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                              • Else
                                              • Set Variable [ $list; Value:MBS( "SmartCard.ListReaders"; $$SmartCard) ]
                                              • Set Variable [ $count; Value:ValueCount ( $list ) ]
                                              • If [ $count < 1 ]
                                              • Show Custom Dialog [ Message: "No SmartCard Readers found."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                              • Else
                                              • Set Variable [ $index; Value:1 ]
                                              • Loop
                                              • New Record/Request
                                              • Set Field [ SmartCard::Reader Name; GetValue($list; $index) ]
                                              • Commit Records/Requests [ No dialog ]
                                              • #next
                                              • Set Variable [ $index; Value:$index + 1 ]
                                              • Exit Loop If [ $index > $count ]
                                              • End Loop
                                              • End If
                                              • End If
                                              Fields used in this script
                                              Scripts used in this script
                                                Layouts used in this script
                                                Tables used in this script
                                                Table occurrences used by this script
                                                Custom Functions used by this script
                                                  Custom menu set used by this script

                                                    Previous Script: [Initialize]Next Script: [Check Status]
                                                    Script NameConnect
                                                    Run script with full access privilegesOff
                                                    Include In MenuNo
                                                    Layouts that use this script
                                                    Scripts that use this script
                                                      Script Definition
                                                      Script Steps
                                                      • Set Variable [ $reader; Value:Get(ScriptParameter) ]
                                                      • Set Variable [ $r; Value:MBS( "SmartCard.Connect"; $$SmartCard; $Reader; "Shared"; "any" ) ]
                                                      • If [ MBS("IsError") ]
                                                      • Show Custom Dialog [ Title: "Connect failed"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                      • Else
                                                      • Set Variable [ $Protocol; Value:MBS("SmartCard.GetActiveProtocol"; $$SmartCard) ]
                                                      • If [ $Protocol = "T0" ]
                                                      • Set Variable [ $$SendHeader; Value:MBS( "SmartCard.HeaderTemplate"; "T0" ) ]
                                                      • Else
                                                      • Set Variable [ $$SendHeader; Value:MBS( "SmartCard.HeaderTemplate"; "T1" ) ]
                                                      • End If
                                                      • Go to Layout [ “Card” (Card) ]
                                                      • Set Field [ Card::Reader; $Reader ]
                                                      • Set Field [ Card::Signature Output; "" ]
                                                      • Set Field [ Card::Certificate; "" ]
                                                      • Perform Script [ “Check Status” ]
                                                      • End If
                                                      Fields used in this script
                                                      Scripts used in this script
                                                      Layouts used in this script
                                                      Tables used in this script
                                                      Table occurrences used by this script
                                                      Custom Functions used by this script
                                                        Custom menu set used by this script

                                                          Previous Script: [Connect]Next Script: [Disconnect]
                                                          Script NameCheck Status
                                                          Run script with full access privilegesOff
                                                          Include In MenuYes
                                                          Layouts that use this script
                                                            Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            Fields used in this script
                                                            Scripts used in this script
                                                              Layouts used in this script
                                                                Tables used in this script
                                                                Table occurrences used by this script
                                                                Custom Functions used by this script
                                                                  Custom menu set used by this script

                                                                    Previous Script: [Check Status]Next Script: [ReadCertificate]
                                                                    Script NameDisconnect
                                                                    Run script with full access privilegesOff
                                                                    Include In MenuYes
                                                                    Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • If [ $$SmartCard ≠ "" ]
                                                                      • Set Variable [ $r; Value:MBS( "SmartCard.DisConnect"; $$SmartCard; "Eject") ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Show Custom Dialog [ Title: "Disconnect failed"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                      • End If
                                                                      • End If
                                                                      • Go to Layout [ “SmartCard” (SmartCard) ]
                                                                      Fields used in this script
                                                                        Scripts used in this script
                                                                          Layouts used in this script
                                                                          Tables used in this script
                                                                            Table occurrences used by this script
                                                                              Custom Functions used by this script
                                                                                Custom menu set used by this script

                                                                                  Previous Script: [Disconnect]Next Script: [PerformSignature]
                                                                                  Script NameReadCertificate
                                                                                  Run script with full access privilegesOff
                                                                                  Include In MenuYes
                                                                                  Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • Set Variable [ $type; Value:"" ]
                                                                                    • If [ Card::CardType = "CARDOS" ]
                                                                                    • Set Variable [ $type; Value:"cardos" ]
                                                                                    • Else If [ Card::CardType = "ACOS04" ]
                                                                                    • Set Variable [ $type; Value:"acos" ]
                                                                                    • Else
                                                                                    • Show Custom Dialog [ Title: "Unhandled card type"; Message: Card::CardType; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                    • Exit Script [ ]
                                                                                    • End If
                                                                                    • Set Variable [ $result; Value:MBS( "SmartCard.ReadCertificate"; $$SmartCard; $type) ]
                                                                                    • If [ MBS("IsError") ]
                                                                                    • Show Custom Dialog [ Title: "Error"; Message: $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                    • Else
                                                                                    • Set Field [ Card::Certificate; $result ]
                                                                                    • Set Variable [ $folder; Value:MBS( "Folders.UserDesktop" ) ]
                                                                                    • Set Variable [ $path; Value:MBS( "Path.AddPathComponent"; $folder; "test.cer") ]
                                                                                    • Set Variable [ $r; Value:MBS("Files.WriteFile"; $result; $path; "hex") ]
                                                                                    • End If
                                                                                    Fields used in this script
                                                                                    Scripts used in this script
                                                                                      Layouts used in this script
                                                                                        Tables used in this script
                                                                                        Table occurrences used by this script
                                                                                        Custom Functions used by this script
                                                                                          Custom menu set used by this script

                                                                                            Previous Script: [ReadCertificate]
                                                                                            Script NamePerformSignature
                                                                                            Run script with full access privilegesOff
                                                                                            Include In MenuYes
                                                                                            Layouts that use this script
                                                                                            Scripts that use this script
                                                                                              Script Definition
                                                                                              Script Steps
                                                                                              • Set Variable [ $type; Value:"" ]
                                                                                              • If [ Card::CardType = "CARDOS" ]
                                                                                              • Set Variable [ $type; Value:"cardos" ]
                                                                                              • Else If [ Card::CardType = "ACOS04" ]
                                                                                              • Set Variable [ $type; Value:"acos" ]
                                                                                              • Else
                                                                                              • Show Custom Dialog [ Title: "Unhandled card type"; Message: Card::CardType; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                              • Exit Script [ ]
                                                                                              • End If
                                                                                              • Set Variable [ $result; Value:MBS( "SmartCard.PerformSignature"; $$SmartCard; $type; Card::Input for Hash) ]
                                                                                              • If [ MBS("IsError") ]
                                                                                              • Show Custom Dialog [ Title: "Error"; Message: $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                              • Else
                                                                                              • Set Field [ Card::Signature Output; $result ]
                                                                                              • Set Variable [ $folder; Value:MBS( "Folders.UserDesktop" ) ]
                                                                                              • Set Variable [ $path; Value:MBS( "Path.AddPathComponent"; $folder; "signature") ]
                                                                                              • Set Variable [ $r; Value:MBS("Files.WriteFile"; $result; $path; "hex") ]
                                                                                              • End If
                                                                                              Fields used in this script
                                                                                              Scripts used in this script
                                                                                                Layouts used in this script
                                                                                                  Tables used in this script
                                                                                                  Table occurrences used by this script
                                                                                                  Custom Functions used by this script
                                                                                                    Custom menu set used by this script

                                                                                                      Download example: SmartCard Signatures

                                                                                                      Used functions:




                                                                                                      Links
                                                                                                      MBS Xojo Plugins