Skip to content

Commit

Permalink
added Trust/KeyCertOptions wrap() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
alekkol authored and vietj committed Nov 16, 2022
1 parent 670dfb2 commit 616cecf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/io/vertx/core/net/KeyCertOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,13 @@ static KeyCertOptions wrap(X509KeyManager keyManager) {
return new KeyManagerFactoryOptions(keyManager);
}

/**
* Returns a {@link KeyCertOptions} from the provided {@link KeyManagerFactory}
*
* @param keyManagerFactory the keyManagerFactory instance
* @return the {@link KeyCertOptions}
*/
static KeyCertOptions wrap(KeyManagerFactory keyManagerFactory) {
return new KeyManagerFactoryOptions(keyManagerFactory);
}
}
4 changes: 4 additions & 0 deletions src/main/java/io/vertx/core/net/KeyManagerFactoryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
*
* As this class is not available because it is part of the internal api the proper usage would be:
* <pre>
* // with a KeyManager
* options.setKeyCertOptions(KeyCertOptions.wrap(keyManager));
*
* // with a KeyManagerFactory
* options.setKeyCertOptions(KeyCertOptions.wrap(keyManagerFactory));
* </pre>
*
* @author <a href="mailto:[email protected]">Hakan Altindag</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
*
* As this class is not available because it is part of the internal api the proper usage would be:
* <pre>
* // with a TrustManager
* options.setTrustOptions(TrustOptions.wrap(trustManager));
*
* // with a TrustManagerFactory
* options.setTrustOptions(TrustOptions.wrap(trustManagerFactory));
* </pre>
*
* @author <a href="mailto:[email protected]">Hakan Altindag</a>
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/io/vertx/core/net/TrustOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,13 @@ static TrustOptions wrap(TrustManager trustManager) {
return new TrustManagerFactoryOptions(trustManager);
}

/**
* Returns a {@link TrustOptions} from the provided {@link TrustManagerFactory}
*
* @param trustManagerFactory the trustManagerFactory instance
* @return the {@link TrustOptions}
*/
static TrustOptions wrap(TrustManagerFactory trustManagerFactory) {
return new TrustManagerFactoryOptions(trustManagerFactory);
}
}

0 comments on commit 616cecf

Please sign in to comment.