예제 #1
0
 public Key(byte[] fromPublicKey)
 {
     _ed25519 = new Rebex.Security.Cryptography.Ed25519();
     _sha256  = new SHA256Managed();
     _ed25519.FromPublicKey(fromPublicKey);
     _publicKey = _ed25519.GetPublicKey();
 }
예제 #2
0
        public static bool Verify(byte[] payload, Ed25519Signature signature)
        {
            var ed25519 = new Rebex.Security.Cryptography.Ed25519();

            ed25519.FromPublicKey(signature.PublicKey.HexToBytes());

            return(ed25519.VerifyMessage(payload, signature.Signature.HexToBytes()));
        }