Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Writes certificate.

Component Version macOS Windows Linux Server iOS SDK
Certificates 9.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "X509.Write"; X509Ref { ; Binary } )   More


Parameter Description Example Flags
X509Ref The reference to the X509 certificate. $cert
Binary Whether to return binary representation (DER format) instead of text (PEM format).
Default is PEM.
0 Optional


Returns text or error.


Writes certificate.
Provides either PEM file as text or DER file base64 encoded.


Calculate x5t for a certificate file:

Let ( [
// read PEM file
cert = MBS( "X509.ReadFromFile"; "/Users/cs/Downloads/Cert.pem" );
// write DER file
data = MBS( "X509.Write"; cert; 1 );
// and free memory
r = MBS( "X509.Release"; cert );
// hash it to get x5t
hash = MBS( "Hash.Digest"; "SHA1"; "Base64"; data; ""; "base64url")
]; hash )

See also

Release notes

This function checks for a license.

Created 22nd February 2019, last changed 14th March 2024

X509.Version - XL.Book.AddConditionalFormat