add constructor to optionally rewrite derivation path

This commit is contained in:
Craig Raw 2024-08-22 11:03:01 +02:00
parent 0e08478294
commit 87b5f992d0

View file

@ -17,9 +17,13 @@ public class KeyDerivation {
} }
public KeyDerivation(String masterFingerprint, String derivationPath) { public KeyDerivation(String masterFingerprint, String derivationPath) {
this(masterFingerprint, derivationPath, false);
}
public KeyDerivation(String masterFingerprint, String derivationPath, boolean rewritePath) {
this.masterFingerprint = masterFingerprint == null ? null : masterFingerprint.toLowerCase(Locale.ROOT); this.masterFingerprint = masterFingerprint == null ? null : masterFingerprint.toLowerCase(Locale.ROOT);
this.derivationPath = derivationPath;
this.derivation = parsePath(derivationPath); this.derivation = parsePath(derivationPath);
this.derivationPath = rewritePath ? writePath(derivation) : derivationPath;
} }
public String getMasterFingerprint() { public String getMasterFingerprint() {