xdev-software / bzst-dip-java-client

Java client library for the BZST - DIP (Bundeszentralamt für Steuern - Digitaler Posteingang)
Apache License 2.0
6 stars 3 forks source link

Make the certificate alias configurable with fallback to "certificate" #59

Closed HenningL closed 3 months ago

HenningL commented 3 months ago

Checklist

Description

By now the certificate alias is hardcoded as "certificate" in SigningUtil. Would be nice if its configurable and fallback as it is if not configured. image

Additional information

No response

JohannesRabauer commented 3 months ago

Hi Henning, thank you for your enhancement idea! We tried to implement your request on branch changeable-keystore-entry-name. Could you please check if this is what you wanted and if this works? Usage see https://github.com/xdev-software/bzst-dip-java-client/blob/changeable-keystore-entry-name/CHANGELOG.md#102

If it works we would create a new release with this feature included.

HenningL commented 3 months ago

Hi Johannes. I checked the changes and saw it is configurable now. I couldnt find the place for the fallback to "certificate", just to keep it backwards compatible if the property is not set. if you think, it becoming a mandatory property to be configured, i am also fine with it.

JohannesRabauer commented 3 months ago

In bzst-dip-java-client/src/main/java/software/xdev/bzst/dip/client/model/configuration/BzstDipConfigurationBuilder.java the following lines set the default alias "certificate", so the property is not mandatory.

this.getSetPropertyOrReadFromFile(
                this.keyStorePrivateKeyAlias,
                PropertiesSupplier.PROPERTY_NAME_KEYSTORE_PRIVATE_KEY_ALIAS,
                "certificate"),

We'll merge the PR now: https://github.com/xdev-software/bzst-dip-java-client/pull/63