Platforms to show: All Mac Windows Linux Cross-Platform

Back to PKeyMBS class.

PKeyMBS.Open(Data as MemoryBlock, password as String = "") as PKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 18.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a private or public key.

Returns key or nil in case of error.
Added optional password parameter for version 24.3.

See also:

PKeyMBS.Open(Data as String, password as String = "") as PKeyMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 18.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opens a private or public key.

Returns key or nil in case of error.
Added optional password parameter for version 24.3.

See also:

PKeyMBS.SignCertificate(params as SignCertificateParametersMBS) as X509MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Encryption and Hash MBS Encryption Plugin 25.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Signs a certificate sign request to make a new 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 rootCert As X509MBS = pRootKey.GenerateRootCertificate(rootCertFields)

// 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)

// let's make a client certificate

Var params As New SignCertificateParametersMBS
params.CSR = clientCSR
params.RootKey = pRootKey
params.RootCert = rootCert

Var ClientCert As X509MBS = pRootKey.SignCertificate(params)

Break

Returns nil in case of failure.

SubjectAltName provides the X509v3 Subject Alternative Name and could e.g. be "DNS:example.com,DNS:www.example.com,IP:127.0.0.1"

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


The biggest plugin in space...