Skip to content

Commit

Permalink
Replaced deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Oct 31, 2024
1 parent 3f96d3d commit b0f5ae8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ public class MainCEFeInvoicingConnectivityTest

static
{
final LoadedKeyStore aLKS = KeyStoreHelper.loadKeyStore (EKeyStoreType.JKS, YOUR_ID + "keystore.jks", "test123");
final LoadedKeyStore aLKS = KeyStoreHelper.loadKeyStore (EKeyStoreType.JKS,
YOUR_ID + "keystore.jks",
"test123".toCharArray ());
if (aLKS.isFailure ())
throw new InitializationException ("KeyStore error: " + aLKS.getErrorText (Locale.US));

final LoadedKeyStore aLTS = KeyStoreHelper.loadKeyStore (EKeyStoreType.JKS, "gateway_truststore.jks", "test123");
final LoadedKeyStore aLTS = KeyStoreHelper.loadKeyStore (EKeyStoreType.JKS,
"gateway_truststore.jks",
"test123".toCharArray ());
if (aLTS.isFailure ())
throw new InitializationException ("TrustStore error: " + aLTS.getErrorText (Locale.US));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public LoadedKeyStore loadKeyStore ()
{
LoadedKeyStore ret = m_aLKS;
if (ret == null)
ret = m_aLKS = KeyStoreHelper.loadKeyStore (m_aType, m_sPath, new String (m_aPassword), m_aProvider);
ret = m_aLKS = KeyStoreHelper.loadKeyStore (m_aType, m_sPath, m_aPassword, m_aProvider);
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public LoadedKeyStore loadTrustStore ()
{
LoadedKeyStore ret = m_aLTS;
if (ret == null)
ret = m_aLTS = KeyStoreHelper.loadKeyStore (m_aType, m_sPath, new String (m_aPassword), m_aProvider);
ret = m_aLTS = KeyStoreHelper.loadKeyStore (m_aType, m_sPath, m_aPassword, m_aProvider);
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public static void main (final String [] args)
// Expired Peppol AP certificate that was valid until 2021
final IAS4CryptoFactory cf = new AS4CryptoFactoryInMemoryKeyStore (KeyStoreHelper.loadKeyStoreDirect (EKeyStoreType.PKCS12,
"peppol-expired-ap-cert-pw-peppol.p12",
"peppol"),
"peppol".toCharArray ()),
"cert",
"peppol".toCharArray (),
KeyStoreHelper.loadKeyStore (PeppolKeyStoreHelper.TRUSTSTORE_TYPE,
PeppolKeyStoreHelper.Config2018.TRUSTSTORE_AP_PILOT_CLASSPATH,
PeppolKeyStoreHelper.TRUSTSTORE_PASSWORD)
PeppolKeyStoreHelper.TRUSTSTORE_PASSWORD.toCharArray ())
.getKeyStore ());

final EAS4UserMessageSendResult eResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ public static void main (final String [] args)

// Start configuring here
final IParticipantIdentifier aReceiverID = Phase4PeppolSender.IF.createParticipantIdentifierWithDefaultScheme ("9914:atu68241501");
final KeyStore aKS = KeyStoreHelper.loadKeyStoreDirect (EKeyStoreType.PKCS12, "test-ap.p12", "peppol");
final KeyStore aKS = KeyStoreHelper.loadKeyStoreDirect (EKeyStoreType.PKCS12,
"test-ap.p12",
"peppol".toCharArray ());
if (aKS == null)
throw new IllegalStateException ();
final IAS4CryptoFactory aInMemoryCryptoFactory = new AS4CryptoFactoryInMemoryKeyStore (aKS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public void onAS4Message (final AbstractAS4Message <?> aMsg)
final IAS4CryptoFactory cf = true ? AS4CryptoFactoryConfiguration.getDefaultInstance ()
: new AS4CryptoFactoryInMemoryKeyStore (KeyStoreHelper.loadKeyStoreDirect (EKeyStoreType.JKS,
"invalid-keystore-pw-peppol.jks",
"peppol"),
"peppol".toCharArray ()),
"1",
"peppol".toCharArray (),
KeyStoreHelper.loadKeyStore (PeppolKeyStoreHelper.TRUSTSTORE_TYPE,
PeppolKeyStoreHelper.Config2018.TRUSTSTORE_AP_PRODUCTION_CLASSPATH,
PeppolKeyStoreHelper.TRUSTSTORE_PASSWORD)
PeppolKeyStoreHelper.TRUSTSTORE_PASSWORD.toCharArray ())
.getKeyStore ());
final EAS4UserMessageSendResult eResult;
eResult = Phase4PeppolSender.builder ()
Expand Down

0 comments on commit b0f5ae8

Please sign in to comment.