Skip to content

Commit

Permalink
Reverted removal of constructor in EncIdPubShare.
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusbechwind committed Nov 29, 2023
1 parent cd810fc commit 2c3e57d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.concordium.sdk.responses.accountinfo.credential;

import lombok.EqualsAndHashCode;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;

import java.util.Arrays;
Expand All @@ -21,6 +22,13 @@ public class EncIdPubShare {
public byte[] getValue() {
return copyOf(value, value.length);
}
public static EncIdPubShare from(final String hex) {
try {
return new EncIdPubShare(Hex.decodeHex(hex));
} catch (DecoderException e) {
throw new IllegalArgumentException(e);
}
}

public static EncIdPubShare from(final byte[] bytes) {
return new EncIdPubShare(Arrays.copyOf(bytes, bytes.length));
Expand Down

0 comments on commit 2c3e57d

Please sign in to comment.