private void _loadCertificates () { // Reset every time _setCertValid (false); _loadError (null, null); m_aTrustStore = null; // Load the trust store final LoadedKeyStore aTrustStoreLoading = KeyStoreHelper.loadKeyStore (SMPServerConfiguration.getTrustStoreType (), SMPServerConfiguration.getTrustStorePath (), SMPServerConfiguration.getTrustStorePassword ()); if (aTrustStoreLoading.isFailure ()) { _loadError (aTrustStoreLoading.getError (), PeppolKeyStoreHelper.getLoadError (aTrustStoreLoading)); throw new InitializationException (s_sInitError); } m_aTrustStore = aTrustStoreLoading.getKeyStore (); LOGGER.info ("SMPTrustManager successfully initialized with truststore '" + SMPServerConfiguration.getTrustStorePath () + "'"); _setCertValid (true); }
if (aLKS.isFailure ()) throw new IllegalStateException (aLKS.getErrorText (TextHelper.EN)); final LoadedKey <KeyStore.PrivateKeyEntry> aLK = KeyStoreHelper.loadPrivateKey (aLKS.getKeyStore (), sKeyStorePath, sKeyAlias,
return new LoadedKeyStore (null, EKeyStoreLoadError.KEYSTORE_NO_PATH); LOGGER.warn ("No such key store '" + sKeyStorePath + "': " + ex.getMessage (), ex.getCause ()); return new LoadedKeyStore (null, EKeyStoreLoadError.KEYSTORE_LOAD_ERROR_NON_EXISTING, sKeyStorePath, bInvalidPW ? null : ex.getCause ()); return new LoadedKeyStore (null, bInvalidPW ? EKeyStoreLoadError.KEYSTORE_INVALID_PASSWORD : EKeyStoreLoadError.KEYSTORE_LOAD_ERROR_FORMAT_ERROR, return new LoadedKeyStore (aKeyStore, null);
PDClientConfiguration.getKeyStorePath (), PDClientConfiguration.getKeyStorePassword ()); if (aLoadedKeyStore.isFailure ()) PDClientConfiguration.getTrustStorePath (), PDClientConfiguration.getTrustStorePassword ()); final KeyStore aTrustStore = aLoadedTrustStore.getKeyStore (); .loadKeyMaterial (aLoadedKeyStore.getKeyStore (), PDClientConfiguration.getKeyStoreKeyPassword (), (aAliases, aSocket) -> {
PDClientConfiguration.getKeyStorePath (), PDClientConfiguration.getKeyStorePassword ()); if (aLoadedKeyStore.isFailure ()) aOL.addItem (_createError ("The " + sDirectoryName + " client certificate configuration is invalid."), new HCDiv ().addChild (PeppolKeyStoreHelper.getLoadError (aLoadedKeyStore)));
@Nullable public static String getLoadError (@Nonnull final LoadedKeyStore aLKS) { return aLKS == null ? null : aLKS.getErrorText (TextHelper.EN); }
sKeyStorePath, PDClientConfiguration.getKeyStorePassword ()); if (aKeyStoreLR.isFailure ()) final KeyStore aKeyStore = aKeyStoreLR.getKeyStore (); final String sKeyStoreAlias = PDClientConfiguration.getKeyStoreKeyAlias (); final LoadedKey <KeyStore.PrivateKeyEntry> aKeyLoading = KeyStoreHelper.loadPrivateKey (aKeyStore,
PDClientConfiguration.getKeyStorePath (), PDClientConfiguration.getKeyStorePassword ()); if (aLoadedKeyStore.isFailure ()) aOL.addItem (_createError ("The " + sDirectoryName + " client certificate configuration is invalid."), new HCDiv ().addChild (PeppolKeyStoreHelper.getLoadError (aLoadedKeyStore)));
private void _loadCertificates () { // Reset every time _setCertValid (false); _loadError (null, null); m_aTrustStore = null; // Load the trust store final LoadedKeyStore aTrustStoreLoading = KeyStoreHelper.loadKeyStore (SMPServerConfiguration.getTrustStoreType (), SMPServerConfiguration.getTrustStorePath (), SMPServerConfiguration.getTrustStorePassword ()); if (aTrustStoreLoading.isFailure ()) { _loadError (aTrustStoreLoading.getError (), PeppolKeyStoreHelper.getLoadError (aTrustStoreLoading)); throw new InitializationException (s_sInitError); } m_aTrustStore = aTrustStoreLoading.getKeyStore (); LOGGER.info ("SMPTrustManager successfully initialized with truststore '" + SMPServerConfiguration.getTrustStorePath () + "'"); _setCertValid (true); }
sKeyStorePath, PDClientConfiguration.getKeyStorePassword ()); if (aKeyStoreLR.isFailure ()) final KeyStore aKeyStore = aKeyStoreLR.getKeyStore (); final String sKeyStoreAlias = PDClientConfiguration.getKeyStoreKeyAlias (); final LoadedKey <KeyStore.PrivateKeyEntry> aKeyLoading = KeyStoreHelper.loadPrivateKey (aKeyStore,
SMPServerConfiguration.getKeyStorePath (), SMPServerConfiguration.getKeyStorePassword ()); if (aLoadedKeyStore.isFailure ()) _loadError (aLoadedKeyStore.getError (), PeppolKeyStoreHelper.getLoadError (aLoadedKeyStore)); throw new InitializationException (s_sInitError); m_aKeyStore = aLoadedKeyStore.getKeyStore ();
SMPServerConfiguration.getKeyStorePath (), SMPServerConfiguration.getKeyStorePassword ()); if (aLoadedKeyStore.isFailure ()) _loadError (aLoadedKeyStore.getError (), PeppolKeyStoreHelper.getLoadError (aLoadedKeyStore)); throw new InitializationException (s_sInitError); m_aKeyStore = aLoadedKeyStore.getKeyStore ();