- java.lang.Object
-
- io.helidon.common.pki.KeyConfig.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyConfig.Builder
addCert(X509Certificate certificate)
Add a certificate to the list of certificates, used e.g.KeyConfig.Builder
addCertChain(X509Certificate certificate)
Add an X.509 certificate instance to the end of certification chain.KeyConfig
build()
Build a new instance of the configuration based on this builder.KeyConfig.Builder
config(Config config)
Updated this builder instance from configuration.KeyConfig.Builder
privateKey(PrivateKey privateKey)
Configure a private key instance (rather then keystore and alias).KeyConfig.Builder
publicKey(PublicKey publicKey)
Configure a public key instance (rather then keystore and certificate alias).KeyConfig.Builder
publicKeyCert(X509Certificate certificate)
Configure an X.509 certificate instance for public key certificate.KeyConfig.Builder
updateWith(KeyConfig.KeystoreBuilder builder)
Update this builder with information from a keystore builder.KeyConfig.Builder
updateWith(KeyConfig.PemBuilder builder)
Update this builder with information from a pem builder.
-
-
-
Method Detail
-
build
public KeyConfig build() throws PkiException
Build a new instance of the configuration based on this builder.- Specified by:
build
in interfaceBuilder<KeyConfig>
- Returns:
- instance from this builder
- Throws:
PkiException
- when keys or certificates fail to load from keystore or when misconfigured
-
privateKey
public KeyConfig.Builder privateKey(PrivateKey privateKey)
Configure a private key instance (rather then keystore and alias).- Parameters:
privateKey
- private key instance- Returns:
- updated builder instance
-
publicKey
public KeyConfig.Builder publicKey(PublicKey publicKey)
Configure a public key instance (rather then keystore and certificate alias).- Parameters:
publicKey
- private key instance- Returns:
- updated builder instance
-
publicKeyCert
public KeyConfig.Builder publicKeyCert(X509Certificate certificate)
Configure an X.509 certificate instance for public key certificate.- Parameters:
certificate
- certificate instance- Returns:
- updated builder instance
-
addCertChain
public KeyConfig.Builder addCertChain(X509Certificate certificate)
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
public KeyConfig.Builder addCert(X509Certificate certificate)
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
public KeyConfig.Builder updateWith(KeyConfig.PemBuilder builder)
Update this builder with information from a pem builder.- Parameters:
builder
- builder obtained fromKeyConfig.pemBuilder()
- Returns:
- updated builder instance
-
updateWith
public KeyConfig.Builder updateWith(KeyConfig.KeystoreBuilder builder)
Update this builder with information from a keystore builder.- Parameters:
builder
- builder obtained fromKeyConfig.keystoreBuilder()
()}- Returns:
- updated builder instance
-
config
public KeyConfig.Builder config(Config 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
-
-