Пример #1
0
        private JwtPayloadDocument(JwtDocument document, byte control, int issIdx)
        {
            _document = document;
            _control  = control;

            _iss = issIdx < 0 ? default : new JwtElement(_document, issIdx);
        }
Пример #2
0
        internal JwtDocument Clone()
        {
            JsonMetadata          newDb       = _parsedData.Clone();
            ReadOnlyMemory <byte> segmentCopy = _utf8Json.ToArray();
            JwtDocument           newDocument = new JwtDocument(segmentCopy, newDb, extraRentedBytes: null, isDisposable: false);

            return(newDocument);
        }
Пример #3
0
        internal JwtElement CloneElement(int index)
        {
            int                   endIndex    = GetEndIndex(index, true);
            JsonMetadata          newDb       = _parsedData.CopySegment(index, endIndex);
            ReadOnlyMemory <byte> segmentCopy = GetRawValue(index, includeQuotes: true).ToArray();

            JwtDocument newDocument = new JwtDocument(segmentCopy, newDb, extraRentedBytes: null, isDisposable: false);

            return(newDocument._root);
        }
Пример #4
0
        internal JwtElement(JwtDocument parent, int idx)
        {
            // parent is usually not null, but the Current property
            // on the enumerators (when initialized as `default`) can
            // get here with a null.
            Debug.Assert(idx >= 0);
            Debug.Assert(parent != null);

            _parent = parent;
            _idx    = idx;
        }
Пример #5
0
        private JwtHeaderDocument(JwtDocument document, int algIdx, int encIdx, int kidIdx, int critIdx)
        {
            _document = document;

            _alg = algIdx < 0 ? default : new JwtElement(_document, algIdx);

                   _enc = encIdx < 0 ? default : new JwtElement(_document, encIdx);

                          _kid = kidIdx < 0 ? default : new JwtElement(_document, kidIdx);

                                 _crit = critIdx < 0 ? default : new JwtElement(_document, critIdx);
        }