[#45] Add the ability to create a client via wallet and password
All checks were successful
DCO / DCO (pull_request) Successful in 27s
Verify code phase / Verify code (pull_request) Successful in 1m38s

Signed-off-by: Ori Bruk <o.bruk@yadro.com>
This commit is contained in:
Ori Bruk 2025-03-04 17:01:51 +03:00
parent fe7d2968b8
commit db74919401
24 changed files with 141 additions and 558 deletions

View file

@ -4,7 +4,6 @@ import com.google.protobuf.ByteString;
import com.google.protobuf.Message;
import info.frostfs.sdk.exceptions.ValidationFrostFSException;
import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.crypto.digests.RIPEMD160Digest;
import java.math.BigInteger;
import java.security.MessageDigest;
@ -15,24 +14,11 @@ import static java.util.Objects.isNull;
public class Helper {
private static final String SHA256 = "SHA-256";
private static final int RIPEMD_160_HASH_BYTE_LENGTH = 20;
private static final int HEX_RADIX = 16;
private Helper() {
}
public static byte[] getRipemd160(byte[] value) {
if (isNull(value)) {
throw new ValidationFrostFSException(INPUT_PARAM_IS_MISSING);
}
var hash = new byte[RIPEMD_160_HASH_BYTE_LENGTH];
var digest = new RIPEMD160Digest();
digest.update(value, 0, value.length);
digest.doFinal(hash, 0);
return hash;
}
public static MessageDigest getSha256Instance() {
try {
return MessageDigest.getInstance(SHA256);