Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
X509.Write
Writes certificate.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Certificates | 9.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "X509.Write"; X509Ref { ; Binary } ) More
Parameters
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 |
Result
Returns text or error.
Description
Writes certificate.Provides either PEM file as text or DER file base64 encoded.
Examples
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
- Version 9.1
- Added X509.Write function.
This function checks for a license.
Created 22nd February 2019, last changed 14th March 2024