PemKeyCertOptions

Key store options configuring a list of private key and its certificate based on <i>Privacy-enhanced Electronic Email</i> (PEM) files.

A key file must contain a non encrypted private key in PKCS8 format wrapped in a PEM block, for example:

-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDV6zPk5WqLwS0a
...
K5xBhtm1AhdnZjx5KfW3BecE
-----END PRIVATE KEY-----

Or contain a non encrypted private key in PKCS1 format wrapped in a PEM block, for example:

-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAlO4gbHeFb/fmbUF/tOJfNPJumJUEqgzAzx8MBXv9Acyw9IRa
...
zJ14Yd+t2fsLYVs2H0gxaA4DW6neCzgY3eKpSU0EBHUCFSXp/1+/
-----END RSA PRIVATE KEY-----

A certificate file must contain an X.509 certificate wrapped in a PEM block, for example:

-----BEGIN CERTIFICATE-----
MIIDezCCAmOgAwIBAgIEZOI/3TANBgkqhkiG9w0BAQsFADBuMRAwDgYDVQQGEwdV
...
+tmLSvYS39O2nqIzzAUfztkYnUlZmB0l/mKkVqbGJA==
-----END CERTIFICATE-----
Keys and certificates can either be loaded by Vert.x from the filesystem:

HttpServerOptions options = new HttpServerOptions();
options.setPemKeyCertOptions(new PemKeyCertOptions().setKeyPath("/mykey.pem").setCertPath("/mycert.pem"));
Or directly provided as a buffer:

Buffer key = vertx.fileSystem().readFileSync("/mykey.pem");
Buffer cert = vertx.fileSystem().readFileSync("/mycert.pem");
options.setPemKeyCertOptions(new PemKeyCertOptions().setKeyValue(key).setCertValue(cert));
Several key/certificate pairs can be used:

HttpServerOptions options = new HttpServerOptions();
options.setPemKeyCertOptions(new PemKeyCertOptions()
   .addKeyPath("/mykey1.pem").addCertPath("/mycert1.pem")
   .addKeyPath("/mykey2.pem").addCertPath("/mycert2.pem"));
package

Default

Methods

PemKeyCertOptions constructor

__construct( $pemKeyCertOptions = null) 

Arguments

$pemKeyCertOptions

mixed | null

getCertPaths

getCertPaths() : array

Response

array

getCertValues

getCertValues() : array

Response

array

getKeyPaths

getKeyPaths() : array

Response

array

getKeyValues

getKeyValues() : array

Response

array

setCertPath

setCertPath( $certPath) : $this

Arguments

$certPath

string

Response

$this

setCertPaths

setCertPaths( $certPaths) : $this

Arguments

$certPaths

string

Response

$this

setCertValue

setCertValue( $certValue) : $this

Arguments

$certValue

Buffer

Response

$this

setCertValues

setCertValues( $certValues) : $this

Arguments

$certValues

Buffer

Response

$this

setKeyPath

setKeyPath( $keyPath) : $this

Arguments

$keyPath

string

Response

$this

setKeyPaths

setKeyPaths( $keyPaths) : $this

Arguments

$keyPaths

string

Response

$this

setKeyValue

setKeyValue( $keyValue) : $this

Arguments

$keyValue

Buffer

Response

$this

setKeyValues

setKeyValues( $keyValues) : $this

Arguments

$keyValues

Buffer

Response

$this