예제 #1
0
        public byte[] VerifySignedMessage(byte[] signedMessage, SignerPublicKey publicKey)
        {
            var message = new byte[signedMessage.Length];
            long messageRealLength = 0;

            var result = PlatformInvoke32.crypto_sign_open(message, ref messageRealLength, signedMessage, signedMessage.Length,
                publicKey.PlainBytes);

            if (result != 0) throw new CryptographicException("Failed");

            Array.Resize(ref message, (int)messageRealLength);
            return message;
        }
예제 #2
0
        public byte[] VerifySignedMessage(byte[] signedMessage, SignerPublicKey publicKey)
        {
            var  message           = new byte[signedMessage.Length];
            long messageRealLength = 0;

            var result = PlatformInvoke64.crypto_sign_open(message, ref messageRealLength, signedMessage, signedMessage.Length,
                                                           publicKey.PlainBytes);

            if (result != 0)
            {
                throw new CryptographicException("Failed");
            }

            Array.Resize(ref message, (int)messageRealLength);
            return(message);
        }
예제 #3
0
 public SignerKeyPair(byte[] secretKeyBytes, byte[] publicKey)
 {
     _secretKeyBytes = secretKeyBytes;
     _publicKey = new SignerPublicKey(publicKey);
 }
예제 #4
0
 public SignerKeyPair(byte[] secretKeyBytes, byte[] publicKey)
 {
     _secretKeyBytes = secretKeyBytes;
     _publicKey      = new SignerPublicKey(publicKey);
 }