java.lang.Object
io.helidon.common.pki.KeyConfig.Builder
- All Implemented Interfaces:
Builder<KeyConfig.Builder,
,KeyConfig> Supplier<KeyConfig>
- Enclosing class:
- KeyConfig
public static class KeyConfig.Builder
extends Object
implements Builder<KeyConfig.Builder,KeyConfig>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCert
(X509Certificate certificate) Add a certificate to the list of certificates, used e.g.addCertChain
(X509Certificate certificate) Add an X.509 certificate instance to the end of certification chain.build()
Build a new instance of the configuration based on this builder.Updated this builder instance from configuration.privateKey
(PrivateKey privateKey) Configure a private key instance (rather then keystore and alias).Configure a public key instance (rather then keystore and certificate alias).publicKeyCert
(X509Certificate certificate) Configure an X.509 certificate instance for public key certificate.updateWith
(KeyConfig.KeystoreBuilder builder) Update this builder with information from a keystore builder.updateWith
(KeyConfig.PemBuilder builder) Update this builder with information from a pem builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Build a new instance of the configuration based on this builder.- Specified by:
build
in interfaceBuilder<KeyConfig.Builder,
KeyConfig> - Returns:
- instance from this builder
- Throws:
PkiException
- when keys or certificates fail to load from keystore or when misconfigured
-
privateKey
Configure a private key instance (rather then keystore and alias).- Parameters:
privateKey
- private key instance- Returns:
- updated builder instance
-
publicKey
Configure a public key instance (rather then keystore and certificate alias).- Parameters:
publicKey
- private key instance- Returns:
- updated builder instance
-
publicKeyCert
Configure an X.509 certificate instance for public key certificate.- Parameters:
certificate
- certificate instance- Returns:
- updated builder instance
-
addCertChain
Add an X.509 certificate instance to the end of certification chain.- Parameters:
certificate
- certificate to add to certification path- Returns:
- updated builder instance
-
addCert
Add a certificate to the list of certificates, used e.g. in a trust store.- Parameters:
certificate
- X.509 certificate to trust- Returns:
- updated builder instance
-
updateWith
Update this builder with information from a pem builder.- Parameters:
builder
- builder obtained fromKeyConfig.pemBuilder()
- Returns:
- updated builder instance
-
updateWith
Update this builder with information from a keystore builder.- Parameters:
builder
- builder obtained fromKeyConfig.keystoreBuilder()
()}- Returns:
- updated builder instance
-
config
Updated this builder instance from configuration. Keys configured will override existing fields in this builder, others will be left intact. If certification path is already defined, configuration based cert-path will be added.- Parameters:
config
- configuration to update this builder from- Returns:
- updated builder instance
-