Пример #1
0
        public async Task <bool> VerifyAsync(JoseHeader header, string data, byte[] signature)
        {
            if (header == null)
            {
                throw new ArgumentNullException(nameof(header));
            }
            if (this.Disposed)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            // Get it from header :)
            if (this.publicKey == null)
            {
                this.SetKey(await header.GetPublicKeyAsync());
            }

            return(this.VerifyInternal(header, data, signature));
        }
Пример #2
0
        public async Task<bool> VerifyAsync(JoseHeader header, string data, byte[] signature)
        {
            if (header == null)
                throw new ArgumentNullException(nameof(header));
            if (this.Disposed)
                throw new ObjectDisposedException(this.GetType().Name);

            // Get it from header :)
            if (this.publicKey == null)
                this.SetKey(await header.GetPublicKeyAsync());

            return this.VerifyInternal(header, data, signature);
        }