Ejemplo n.º 1
0
 internal static void Validate(this BewitOptions options)
 {
     if (string.IsNullOrWhiteSpace(options.Secret))
     {
         throw new ArgumentException(
                   "Value cannot be null or whitespace.", nameof(options.Secret));
     }
 }
Ejemplo n.º 2
0
        public HmacSha256CryptographyService(BewitOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (string.IsNullOrWhiteSpace(options.Secret))
            {
                throw new ArgumentNullException(nameof(options.Secret));
            }

            _secret = options.Secret;
        }