Esempio n. 1
0
        public ISignature Sign(ReadOnlySpan <byte> data, SigningContext signingContext)
        {
            var privateKey = GetPrivateKey(KeyRegistryTypes.DefaultKey);

            using var pooled = signingContext.SerializeToPooledBytes();

            return(_cryptoContext.Sign(privateKey, data, pooled.Span));
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public bool Verify(ISignature signature, ReadOnlySpan <byte> data, SigningContext signingContext)
        {
            using var pooled = signingContext.SerializeToPooledBytes();

            return(_cryptoContext.Verify(signature, data, pooled.Span));
        }