public class PemTrustOptions extends Object implements TrustOptions, Cloneable
Validating certificates must contain X.509 certificates wrapped in a PEM block:
-----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIEVmLkwTANBgkqhkiG9w0BAQsFADBuMRAwDgYDVQQGEwdV ... z5+DuODBJUQst141Jmgq8bS543IU/5apcKQeGNxEyQ== -----END CERTIFICATE-----The certificates can either be loaded by Vert.x from the filesystem:
HttpServerOptions options = new HttpServerOptions(); options.setPemTrustOptions(new PemTrustOptions().addCertPath("/cert.pem"));Or directly provided as a buffer:
Buffer cert = vertx.fileSystem().readFileBlocking("/cert.pem"); HttpServerOptions options = new HttpServerOptions(); options.setPemTrustOptions(new PemTrustOptions().addCertValue(cert));
Constructor and Description |
---|
PemTrustOptions()
Default constructor
|
PemTrustOptions(JsonObject json)
Create options from JSON
|
PemTrustOptions(PemTrustOptions other)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
PemTrustOptions |
addCertPath(String certPath)
Add a certificate path
|
PemTrustOptions |
addCertValue(Buffer certValue)
Add a certificate value
|
PemTrustOptions |
clone() |
boolean |
equals(Object o) |
List<String> |
getCertPaths() |
List<Buffer> |
getCertValues() |
int |
hashCode() |
JsonObject |
toJson()
Convert to JSON
|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
copy, getTrustManagerFactory, trustManagerMapper
public PemTrustOptions()
public PemTrustOptions(PemTrustOptions other)
other
- the options to copypublic PemTrustOptions(JsonObject json)
json
- the JSONpublic JsonObject toJson()
public List<String> getCertPaths()
public PemTrustOptions addCertPath(String certPath) throws NullPointerException
certPath
- the path to addNullPointerException
public PemTrustOptions addCertValue(Buffer certValue) throws NullPointerException
certValue
- the value to addNullPointerException
public PemTrustOptions clone()
clone
in interface TrustOptions
clone
in class Object
Copyright © 2020 Eclipse. All rights reserved.