-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from solver-it-sro/support-different-pins
Support different PINs, forced batch signing and live settings updates
- Loading branch information
Showing
33 changed files
with
698 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 0 additions & 132 deletions
132
src/main/java/digital/slovensko/autogram/core/CliParameters.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/java/digital/slovensko/autogram/core/DriverDetectorSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package digital.slovensko.autogram.core; | ||
|
||
public interface DriverDetectorSettings { | ||
String getCustomKeystorePath(); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/digital/slovensko/autogram/core/PasswordManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package digital.slovensko.autogram.core; | ||
|
||
import digital.slovensko.autogram.ui.UI; | ||
import eu.europa.esig.dss.token.PasswordInputCallback; | ||
|
||
import java.util.Arrays; | ||
|
||
public class PasswordManager implements PasswordInputCallback { | ||
private final UI ui; | ||
private final PasswordManagerSettings settings; | ||
private char[] cachedPassword; | ||
|
||
public PasswordManager(UI ui, PasswordManagerSettings settings) { | ||
this.ui = ui; | ||
this.settings = settings; | ||
} | ||
|
||
public char[] getContextSpecificPassword() { | ||
if (settings.getCacheContextSpecificPasswordEnabled()) { | ||
if (cachedPassword == null) { | ||
cachedPassword = ui.getContextSpecificPassword(); | ||
} | ||
return cachedPassword; | ||
} else { | ||
return ui.getContextSpecificPassword(); | ||
} | ||
} | ||
|
||
public void reset() { | ||
if (cachedPassword != null) | ||
Arrays.fill(cachedPassword, '\0'); | ||
} | ||
|
||
@Override | ||
public char[] getPassword() { | ||
return ui.getKeystorePassword(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/digital/slovensko/autogram/core/PasswordManagerSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package digital.slovensko.autogram.core; | ||
|
||
public interface PasswordManagerSettings { | ||
boolean getCacheContextSpecificPasswordEnabled(); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/digital/slovensko/autogram/core/SignatureTokenSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package digital.slovensko.autogram.core; | ||
|
||
public interface SignatureTokenSettings { | ||
boolean getForceContextSpecificLoginEnabled(); | ||
int getSlotIndex(); | ||
} |
Oops, something went wrong.