I'm trying to update from Spring Vault 3.0.2 to 3.1.0 (through spring-cloud-starter-vault-config) and I'm having an issue where, having created an instance of the CertificateBundle, I get null when I try to get the private key back.
Here's a simple test case to illustrate.
@Test
void shouldNotThrowNullPointerExceptionWhenGettingPrivateKey() {
var serialNumber = "aserialnumber";
var certificate = "certificate";
var caCertificate = "caCertificate";
var privateKey = "aprivatekey";
var certificateBundle =
CertificateBundle.of(serialNumber, certificate, caCertificate, privateKey);
Assertions.assertThat(certificateBundle.getPrivateKey()).isNotNull();
}
Hello,
I'm trying to update from Spring Vault 3.0.2 to 3.1.0 (through spring-cloud-starter-vault-config) and I'm having an issue where, having created an instance of the CertificateBundle, I get
null
when I try to get the private key back.Here's a simple test case to illustrate.
I had a look at the code and it seems to me that the order of arguments is transposed on this line https://github.com/spring-projects/spring-vault/blob/74ff3b648dae1f6eedc403b782db003dec575aaf/spring-vault-core/src/main/java/org/springframework/vault/support/CertificateBundle.java#L98
That is, it's passing null as the
privateKey
argument and passing the intended private key to theprivateKeyType
argument.Does that look/sound like it makes sense? Thanks for your assistance.