Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

/Encryption/X509 Certificate
Function:
Required plugins for this example: MBS Encryption Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Encryption/X509 Certificate
This example is the version from Fri, 22th Dec 2016.
Project "X509 Certificate.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() dim f as FolderItem = GetOpenFolderItem("") if f <> nil then List.DeleteAllRows output.Text = "" dim b as BinaryStream = BinaryStream.Open(f) dim s as string = b.Read(b.Length) dim x as X509MBS = X509MBS.Open(s) if x = nil then MsgBox "Failed to open certificate." else Output.Text = x.Description 'dim data as string = x.Data dim d as Dictionary List.AddRow "Name", x.Name List.AddRow "SerialNumber", x.SerialNumber List.AddRow "Version", str(x.Version) // 2 means version 3! List.AddFolder "Subject Name" List.RowTag(List.LastIndex) = x.SubjectName List.Expanded(List.LastIndex) = true List.AddFolder "Issuer Name" List.RowTag(List.LastIndex) = x.IssuerName List.Expanded(List.LastIndex) = true dim p as PKeyMBS = x.PublicKey if p <> nil then 'dim PublicKeyData as string = p.PublicKeyData 'dim PrivateKeyData as string = p.PrivateKeyData 'dim PublicKey as string = p.PublicKey 'dim PrivateKey as string = p.PrivateKey List.AddRow "Type", p.TypeString List.AddRow "Bits", str(p.Bits) end if end if end if End EventHandler
End Control
Control Output Inherits TextArea
ControlInstance Output Inherits TextArea
End Control
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub ExpandRow(row As Integer) dim d as Dictionary = me.RowTag(row) if d <> nil then for each key as Variant in d.keys List.AddRow key, d.Value(key) next end if End EventHandler
End Control
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Encryption Plugin.




Links
MBS FileMaker blog