static Optional<PrivateKey> resolvePrivateKey(Config config) { KeyConfig.PemBuilder pemBuilder = KeyConfig.pemBuilder().config(config); KeyConfig.KeystoreBuilder keystoreBuilder = KeyConfig.keystoreBuilder().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. * * @param config configuration to update this builder from * @return updated builder instance */ public Builder config(Config config) { updateWith(pemBuilder().config(config)); updateWith(keystoreBuilder().config(config)); return this; } }
private JwkKeys loadPlainPublicKey(String stringContent) { return JwkKeys.builder() .addKey(JwkRSA.builder() .publicKey((RSAPublicKey) KeyConfig.pemBuilder() .publicKey(Resource.create("public key from PKCS8", stringContent)) .build() .publicKey() .orElseThrow(() -> new DeploymentException( "Failed to load public key from string content"))) .build()) .build(); }
static Optional<PrivateKey> resolvePrivateKey(Config config) { KeyConfig.PemBuilder pemBuilder = KeyConfig.pemBuilder().config(config); KeyConfig.KeystoreBuilder keystoreBuilder = KeyConfig.keystoreBuilder().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. * * @param config configuration to update this builder from * @return updated builder instance */ public Builder config(Config config) { updateWith(pemBuilder().config(config)); updateWith(keystoreBuilder().config(config)); return this; } }
private JwkKeys loadPlainPublicKey(String stringContent) { return JwkKeys.builder() .addKey(JwkRSA.builder() .publicKey((RSAPublicKey) KeyConfig.pemBuilder() .publicKey(Resource.create("public key from PKCS8", stringContent)) .build() .publicKey() .orElseThrow(() -> new DeploymentException( "Failed to load public key from string content"))) .build()) .build(); }