예제 #1
0
        /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
        public JwtMember(JsonEncodedText memberName, string value)
        {
            if (value == null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.value);
            }

            Type  = JwtValueKind.String;
            Value = value;
            Name  = memberName;
        }
예제 #2
0
 internal static Exception CreateInvalidOperationException_NotSupportedJsonType(JwtValueKind type) => new InvalidOperationException($"The type {type} is not supported.");
예제 #3
0
 internal static void ThrowInvalidOperationException_NotSupportedJsonType(JwtValueKind type) => throw CreateInvalidOperationException_NotSupportedJsonType(type);
예제 #4
0
 private static Exception CreateJwtDescriptorException_HeaderMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => new JwtDescriptorException($"The header parameter '{utf8Name}' must be of type {type}.");
예제 #5
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, ulong value)
 {
     Type  = JwtValueKind.UInt64;
     Value = value;
     Name  = memberName;
 }
예제 #6
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, uint value)
 {
     Type  = JwtValueKind.UInt32;
     Value = value;
     Name  = memberName;
 }
예제 #7
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, object?[] value)
 {
     Type  = JwtValueKind.Array;
     Value = value;
     Name  = memberName;
 }
예제 #8
0
 public static bool IsInteger(this JwtValueKind kind)
 {
     return(((uint)kind & 0x80) != 0x00);
 }
예제 #9
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, float value)
 {
     Type  = JwtValueKind.Float;
     Value = value;
     Name  = memberName;
 }
예제 #10
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, bool value)
 {
     Type  = value ? JwtValueKind.True : JwtValueKind.False;
     Value = value;
     Name  = memberName;
 }
예제 #11
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, double value)
 {
     Type  = JwtValueKind.Double;
     Value = value;
     Name  = memberName;
 }
예제 #12
0
 public static bool IsStringOrArray(this JwtValueKind kind)
 {
     return(((uint)kind & 0x0c) != 0x00);
 }
예제 #13
0
 public static bool IsFloat(this JwtValueKind kind)
 {
     return(((uint)kind & 0x40) != 0x00);
 }
예제 #14
0
 internal static void ThrowJwtDescriptorException_ClaimMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => throw CreateJwtDescriptorException_ClaimMustBeOfType(utf8Name, type);
예제 #15
0
 /// <summary>Initializes a new instance of the <see cref="JwtMember"/> class.</summary>
 public JwtMember(JsonEncodedText memberName, JsonEncodedText value)
 {
     Type  = JwtValueKind.JsonEncodedString;
     Value = value;
     Name  = memberName;
 }
예제 #16
0
 private static Exception CreateJwtDescriptorException_ClaimMustBeOfType(JsonEncodedText utf8Name, JwtValueKind type) => new JwtDescriptorException($"The claim '{utf8Name}' must be of type {type}.");
예제 #17
0
 public static bool IsNumber(this JwtValueKind kind)
 {
     return(((uint)kind & 0xc0) != 0x00);
 }