Skip to content

Commit

Permalink
Fix typo in Credentials.getPublicKey.
Browse files Browse the repository at this point in the history
Was Credentials.getPubicKey missing 'l'.

Signed-off-by: Achim Kraus <[email protected]>
  • Loading branch information
Achim Kraus committed Oct 25, 2021
1 parent 3eb6a19 commit 535704a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public static DtlsConnectorConfig.Builder createDtlsConfig(ClientBaseConfig clie
identity.getCertificateChain(), certificateTypes));
} else if (certificateTypes.contains(CertificateType.RAW_PUBLIC_KEY)) {
dtlsConfig.setCertificateIdentityProvider(
new SingleCertificateProvider(identity.getPrivateKey(), identity.getPubicKey()));
new SingleCertificateProvider(identity.getPrivateKey(), identity.getPublicKey()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ public void defaults() {
} else if (identity.certificate.getPrivateKey() == null) {
LOGGER.info("x509 identity from certificate and private key.");
credentials = new Credentials(identity.privateKey.getPrivateKey(),
identity.certificate.getPubicKey(), identity.certificate.getCertificateChain());
identity.certificate.getPublicKey(), identity.certificate.getCertificateChain());
} else {
LOGGER.info("x509 identity from certificate.");
credentials = identity.certificate;
}
if (credentials.getPrivateKey() == null) {
throw new IllegalArgumentException("Missing private key!");
}
if (credentials.getPubicKey() == null) {
if (credentials.getPublicKey() == null) {
throw new IllegalArgumentException("Missing public key or certificate!");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ public PrivateKey getPrivateKey() {
*
* @return public key
*/
public PublicKey getPubicKey() {
public PublicKey getPublicKey() {
return publicKey;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ public void testLoadPemCredentialsV2() throws IOException, GeneralSecurityExcept
Credentials credentials = SslContextUtil.loadCredentials(SslContextUtil.CLASSPATH_SCHEME + "certs/ec_private.pem", null, null, null);
assertThat(credentials, is(notNullValue()));
assertThat(credentials.getPrivateKey(), is(notNullValue()));
assertThat(credentials.getPubicKey(), is(notNullValue()));
assertSigning("PEMv2", credentials.getPrivateKey(), credentials.getPubicKey(), "SHA256withECDSA");
assertThat(credentials.getPublicKey(), is(notNullValue()));
assertSigning("PEMv2", credentials.getPrivateKey(), credentials.getPublicKey(), "SHA256withECDSA");
}

@Test
Expand All @@ -306,7 +306,7 @@ public void testLoadEdDsaCredentials() throws IOException, GeneralSecurityExcept
assertThat(credentials.getCertificateChain(), is(notNullValue()));
assertThat(credentials.getCertificateChain().length, is(greaterThan(0)));
assertThat(credentials.getCertificateChain()[0].getPublicKey(), is(notNullValue()));
assertSigning("JKS", credentials.getPrivateKey(), credentials.getPubicKey(), "ED25519");
assertSigning("JKS", credentials.getPrivateKey(), credentials.getPublicKey(), "ED25519");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public static Credentials getCredentials(String alias) {
* @since 2.4
*/
public static KeyPair getServerKeyPair() {
return new KeyPair(serverCredentials.getPubicKey(), serverCredentials.getPrivateKey());
return new KeyPair(serverCredentials.getPublicKey(), serverCredentials.getPrivateKey());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void testEnsureSignatureAlgorithmForEdDsa() throws GeneralSecurityExcepti
Credentials credentials = DtlsTestTools.getCredentials("clienteddsa");
assumeNotNull("clienteddsa credentials missing!", credentials);
List<SignatureAndHashAlgorithm> algorithms = new ArrayList<>();
SignatureAndHashAlgorithm.ensureSignatureAlgorithm(algorithms, credentials.getPubicKey());
SignatureAndHashAlgorithm.ensureSignatureAlgorithm(algorithms, credentials.getPublicKey());
assertThat(algorithms.size(), is(1));
assertThat(algorithms, hasItem(SignatureAndHashAlgorithm.INTRINSIC_WITH_ED25519));
}
Expand Down

0 comments on commit 535704a

Please sign in to comment.