SetHeader() public method

public SetHeader ( string key, string value ) : void
key string
value string
return void
        public void TestSerializer()
        {
            var expected = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.YXBwbGU.9CofnzzDvqCYT_tuMqaBXAgX9yZSsbTMEAsz5EolTU4";
            var payload = "apple";
            var key = "1234567890123456";

            var joseHeader = new JoseHeader(JsonWebAlgorithm.HS256);
            joseHeader.SetHeader(JoseHeaderSpec.TYP, "JWT");

            var serializer = new JwsSerializer(joseHeader, payload, key);
            var jwsToken = serializer.CompactSerialization();

            Assert.AreEqual(expected, jwsToken);

            serializer = new JwsSerializer(jwsToken, key);
            var actual = serializer.CompactDeserialization();

            Assert.AreEqual(payload, actual);
        }
        public string toJws(string iss, string alg, string key, string payload)
        {
            JoseHeader header = new JoseHeader();
            header.SetHeader(JoseHeaderSpec.ALG, alg);
            header.SetHeader(JoseHeaderSpec.KID, iss);

            return new Jose().Configuration(
                JoseBuilders.JsonSignatureCompactSerializationBuilder()
                    .Header(header)
                    .Payload(payload)
                    .Key(key)
                ).Serialization();
        }