Skip to content

Commit

Permalink
Introduced constant for adjusted leaf cert config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaehren committed Jan 29, 2025
1 parent 8fd07f3 commit 213e774
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

public class CertificateDelegate extends Delegate {

public static final int PREDEFINED_LEAF_CERT_INDEX = 0;

@Parameter(names = "-cert", description = "PEM encoded certificate file")
private String certificate = null;

Expand Down Expand Up @@ -117,7 +119,8 @@ public void applyDelegate(Config config) {
if (key != null) {
LOGGER.debug("Loading private key");
privateKey = PemUtil.readPrivateKey(new File(key));
adjustPrivateKey(config.getCertificateChainConfig().get(0), privateKey);
adjustPrivateKey(
config.getCertificateChainConfig().get(PREDEFINED_LEAF_CERT_INDEX), privateKey);
}
if (certificate != null) {
if (privateKey == null) {
Expand Down

0 comments on commit 213e774

Please sign in to comment.