Skip to content

Commit

Permalink
dotnet.Nyzo.CL - Update NyzoUtil.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminvanrenterghem committed May 11, 2024
1 parent 831db0d commit cf86814
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dotnet.Nyzo.CL/NyzoUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

namespace Nyzo.CL;

// Untested - todo
public static class NyzoUtil {
public static byte[] HexStringAsByteArray(string identifier){
identifier = identifier.Replace("-", "");
Expand Down Expand Up @@ -127,7 +126,7 @@ public static bool IsValidPrivateSeed(string seedString){
var isValid = false;

seedString = seedString.Trim();
var key = NyzoStringEncoder.DecodePrivateSeed(seedString);
var key = NyzoStringEncoder.DecodePrivateKey(seedString);
isValid = key is not null;

return isValid;
Expand Down Expand Up @@ -184,7 +183,7 @@ public static byte[] GetSignedMessageContent(byte[] signedMessage, byte[] public
try {
return Sodium.PublicKeyAuth.Verify(signedMessage, publicIdentifier);
} catch(CryptographicException e) {
throw new InvalidOperationException("Validate the message first", e);
throw new InvalidOperationException("Validate the arguments with IsValidSignedMessage first", e);
}
}

Expand Down

0 comments on commit cf86814

Please sign in to comment.