/** * @return The type to the keystore. This is usually JKS. Property * <code>keystore.type</code>. */ @Nonnull public static EKeyStoreType getKeyStoreType () { final String sType = s_aConfigFile.getAsString ("keystore.type"); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, EKeyStoreType.JKS); }
@Nullable public EKeyStoreType getKeyStoreType () { final String sProp = _getProperty ("org.apache.wss4j.crypto.merlin.keystore.type"); return EKeyStoreType.getFromIDOrNull (sProp); }
/** * @return The type to the truststore. This is usually JKS. Property * <code>truststore.type</code>. * @since 0.6.0 */ @Nonnull public static EKeyStoreType getTrustStoreType () { final String sType = s_aConfigFile.getAsString ("truststore.type"); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, DEFAULT_TRUSTSTORE_TYPE); }
/** * @return The truststore type as specified in the configuration file by the * key <code>truststore.type</code>. If none is present * {@link PeppolKeyStoreHelper#TRUSTSTORE_TYPE} is returned as a * default. * @since 6.0.0 */ @Nonnull public static EKeyStoreType getTrustStoreType () { final String sType = s_aConfigFile.getAsString ("truststore.type"); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, PeppolKeyStoreHelper.TRUSTSTORE_TYPE); }
/** * @return The type to the keystore. This is usually JKS. Property * <code>smp.keystore.type</code>. * @since 5.0.4 */ @Nonnull public static EKeyStoreType getKeyStoreType () { final String sType = getConfigFile ().getAsString (KEY_SMP_KEYSTORE_TYPE); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, EKeyStoreType.JKS); }
/** * @return The type to the keystore. This is usually JKS. Property * <code>smp.keystore.type</code>. * @since 5.0.4 */ @Nonnull public static EKeyStoreType getKeyStoreType () { final String sType = getConfigFile ().getAsString (KEY_SMP_KEYSTORE_TYPE); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, EKeyStoreType.JKS); }
/** * @return The type to the truststore. This is usually JKS. Property * <code>smp.truststore.type</code>. */ @Nonnull public static EKeyStoreType getTrustStoreType () { final String sType = getConfigFile ().getAsString (KEY_SMP_TRUSTSTORE_TYPE); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, EKeyStoreType.JKS); }
/** * @return The type to the truststore. This is usually JKS. Property * <code>smp.truststore.type</code>. */ @Nonnull public static EKeyStoreType getTrustStoreType () { final String sType = getConfigFile ().getAsString (KEY_SMP_TRUSTSTORE_TYPE); return EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, EKeyStoreType.JKS); }
@Override public void initDynamicComponent (@Nonnull final IAS2Session aSession, @Nullable final IStringMap aOptions) throws OpenAS2Exception { super.initDynamicComponent (aSession, aOptions); try { final String sKeyStoreType = attrs ().getAsString (ATTR_TYPE); final EKeyStoreType eKeyStoreType = EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sKeyStoreType, DEFAULT_KEY_STORE_TYPE); m_aKeyStore = createNewKeyStore (eKeyStoreType); } catch (final Exception ex) { throw WrappedOpenAS2Exception.wrap (ex); } load (getFilename (), getPassword ()); }
/** * @return A list of trust stores configured. Property names are * <code>truststore.X.type</code>, <code>truststore.X.path</code>, * <code>truststore.X.password</code>, * <code>truststore.X.alias</code>, where "X" is an ascending number * starting from 1. * @since 0.6.0 */ @Nonnull public static ICommonsList <PDConfiguredTrustStore> getAllTrustStores () { final ICommonsList <PDConfiguredTrustStore> ret = new CommonsArrayList <> (); int nIndex = 1; while (true) { final String sPrefix = "truststore." + nIndex; final String sType = getConfigFile ().getAsString (sPrefix + ".type"); final EKeyStoreType eType = EKeyStoreType.getFromIDCaseInsensitiveOrDefault (sType, PeppolKeyStoreHelper.TRUSTSTORE_TYPE); final String sPath = getConfigFile ().getAsString (sPrefix + ".path"); final String sPassword = getConfigFile ().getAsString (sPrefix + ".password"); final String sAlias = getConfigFile ().getAsString (sPrefix + ".alias"); if (StringHelper.hasNoText (sPath) || StringHelper.hasNoText (sPassword) || StringHelper.hasNoText (sAlias)) break; // Present - try next ret.add (new PDConfiguredTrustStore (eType, sPath, sPassword, sAlias)); ++nIndex; } return ret; }