Platforms to show: All Mac Windows Linux Cross-Platform

Back to PKeyMBS class.

PKeyMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The private constructor.

Creates a new empty key.
This constructor is private to make sure you don't create an object from this class by error. Please use designated functions to create objects.

PKeyMBS.Copy as PKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a copy of the key.

PKeyMBS.GenerateCertificateSigningRequest(Fields as Dictionary) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a certificate signing request.
Example
// and a client kesy
var clientKey as String = OpenSSLMBS.GeneratePrivateKey
Var pclientKey As PKeyMBS = PKeyMBS.Open(clientKey)

// and we request a client certificate
Var clientCertFields As New Dictionary
clientCertFields.Value("C") = "US"
clientCertFields.Value("O") = "Client Org"
clientCertFields.Value("CN") = "Client Company"
var clientCSR as String = pclientKey.GenerateCertificateSigningRequest(clientCertFields)

break

The Fields dictionary allows you to pass text strings for company, organization and a few more.
Returns nil in case of failure.

PKeyMBS.GenerateRootCertificate(Fields as Dictionary, params as SignCertificateParametersMBS = nil) as X509MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 25.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Generates a root certificate.
Example
// we need a root key
Var RootKey As String = OpenSSLMBS.GeneratePrivateKey
Var pRootKey As PKeyMBS = PKeyMBS.Open(RootKey)

// and a root certificate
Var rootCertFields As New Dictionary
rootCertFields.Value("C") = "US"
rootCertFields.Value("O") = "MyOrg Root CA"
rootCertFields.Value("CN") = "MyRootCA"

Var param As New SignCertificateParametersMBS

param.BasicConstraints = "critical,CA:TRUE"
param.KeyUsage = "critical,keyCertSign,cRLSign"
param.authorityKeyIdentifier = "keyid:always,issuer"
param.expireAfterTime = 31536000 * 2 // 2 years

Var rootCert As X509MBS = pRootKey.GenerateRootCertificate(rootCertFields, param)

var des as string = rootCert.Description

Break

The Fields dictionary allows you to pass text strings for company, organization and a few more.
Returns nil in case of failure.
Expiration time in seconds.

Does not use RootKey or RootCert values in the SignCertificateParametersMBS object.

PKeyMBS.PrivateKeyData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The key as binary representation.

You can write this to a pem file.

Some examples using this method:

PKeyMBS.PublicKeyData as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Encryption and Hash MBS Encryption Plugin 17.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The key as binary representation.

You can write this to a pem file.

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


The biggest plugin in space...