public static final class KeyConfig.PemBuilder extends Object implements Builder<KeyConfig>
KeyConfig.pemBuilder().
If you have "standard" linux/unix private key, you must run "
openssl pkcs8 -topk8 -in ./id_rsa -out ./id_rsa.p8" on it to work with this builder for password protected
file; or "openssl pkcs8 -topk8 -in ./id_rsa -out ./id_rsa_nocrypt.p8 -nocrypt" for unprotected file.
The only supported format is PKCS#8. If you have a different format, you must to transform it to PKCS8 PEM format (to
use this builder), or to PKCS#12 keystore format (and use KeyConfig.KeystoreBuilder).| Modifier and Type | Method and Description |
|---|---|
KeyConfig |
build()
Build
KeyConfig based on information from PEM files only. |
KeyConfig.PemBuilder |
certChain(Resource resource)
Load certificate chain from PEM resource.
|
KeyConfig.PemBuilder |
config(Config config)
Update this builder from configuration.
|
KeyConfig.PemBuilder |
key(Resource resource)
Read a private key from PEM format from a resource definition.
|
KeyConfig.PemBuilder |
keyPassphrase(char[] passphrase)
Passphrase for private key.
|
KeyConfig.PemBuilder |
publicKey(Resource resource)
Read a public key from PEM format from a resource definition.
|
KeyConfig.Builder |
toFullBuilder()
Get a builder filled from this builder to add additional information (such as public key from certificate etc.).
|
public KeyConfig.PemBuilder key(Resource resource)
resource - key resource (file, classpath, URL etc.)public KeyConfig.PemBuilder publicKey(Resource resource)
resource - key resource (file, classpath, URL etc.)public KeyConfig.PemBuilder keyPassphrase(char[] passphrase)
passphrase - passphrase used to encrypt the private keypublic KeyConfig.PemBuilder certChain(Resource resource)
resource - resource (e.g. classpath, file path, URL etc.)public KeyConfig.Builder toFullBuilder()
KeyConfigpublic KeyConfig.PemBuilder config(Config config)
config - configuration to update builder fromCopyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.