Platforms to show: All Mac Windows Linux Cross-Platform

Back to X509MBS class.

X509MBS.CheckCertificates(rootCertificates() as X509MBS, certificate as X509MBS, intermediates() as X509MBS = nil) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 22.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Validates certificate agains root certificates and may use intermediates for it.

Returns true if valid or false if not.

This function attempts to discover and validate a certificate chain based on parameters in context. The verification context, is constructed using given root certificates.

X509MBS.Open(Data as MemoryBlock) as X509MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a X509 PEM file.

Line endings must be LF, not CR.

See also:

X509MBS.Open(Data as String) as X509MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a X509 PEM file.

Please read file via binarystream and pass here as string.
Line endings must be LF, not CR.

See also:

X509MBS.ReadFromPkcs12(Data as String, Pass as String, byref PKey as PKeyMBS, byref Cert as X509MBS, byref certs() as X509MBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads certificate and private key from a PKCS12 file.
Example
dim f as FolderItem = FindFile("test.p12")
dim b as BinaryStream = BinaryStream.Open(f)
dim s as string = b.Read(b.Length)
dim c as X509MBS
dim p as PKeyMBS
dim others() as X509MBS

if X509MBS.ReadFromPkcs12(s, "HelloWorld", p, c, others) then
MsgBox c.Name
end if

Data is the content of the PKCS12 file.
Returns true on success or false on failure.

Some examples using this method:

X509MBS.ReadFromPkcs7(Data as String, Pass as String, byref certs() as X509MBS) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 21.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reads certificates from PKCS#7 data.
Example
dim contents as string // PKCS#7 file data
Dim certs() As X509MBS
If X509MBS.ReadFromPkcs7(contents, "", certs) Then

Dim x As X509MBS = certs(0)
If x <> Nil Then
// show it
TextArea1.Text= x.Description
end if
End If

Returns true on success.
Only for PKCS#7 data containing signatures.

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


The biggest plugin in space...