Esempio n. 1
0
        public PA_DATA(AsnElt body)
        {
            //if (body.Sub.Length != 2)
            //{
            //    throw new System.Exception("PA-DATA should contain two elements");
            //}

            //Console.WriteLine("tag: {0}", body.Sub[0].Sub[1].TagString);
            type = (Interop.PADATA_TYPE)body.Sub[0].Sub[0].GetInteger();
            byte[] valueBytes = body.Sub[1].Sub[0].GetOctetString();

            switch (type)
            {
            case Interop.PADATA_TYPE.PA_PAC_REQUEST:
                value = new KERB_PA_PAC_REQUEST(AsnElt.Decode(body.Sub[1].Sub[0].CopyValue()));
                break;

            case Interop.PADATA_TYPE.PK_AS_REP:
                value = new PA_PK_AS_REP(AsnElt.Decode(body.Sub[1].Sub[0].CopyValue()));
                break;
            }
        }
Esempio n. 2
0
        public PA_DATA(AsnElt body)
        {
            //if (body.Sub.Length != 2)
            //{
            //    throw new System.Exception("PA-DATA should contain two elements");
            //}

            //Console.WriteLine("tag: {0}", body.Sub[0].Sub[1].TagString);
            type = (Interop.PADATA_TYPE)body.Sub[0].Sub[0].GetInteger();
            byte[] valueBytes = body.Sub[1].Sub[0].GetOctetString();

            if (type == Interop.PADATA_TYPE.PA_PAC_REQUEST)
            {
                value = new KERB_PA_PAC_REQUEST(AsnElt.Decode(body.Sub[1].Sub[0].CopyValue()));
            }
            else if (type == Interop.PADATA_TYPE.ENC_TIMESTAMP)
            {
                // TODO: parse PA-ENC-TIMESTAMP
            }
            else if (type == Interop.PADATA_TYPE.AP_REQ)
            {
                // TODO: parse AP_REQ
            }
        }
Esempio n. 3
0
        //PA-DATA         ::= SEQUENCE {
        //        -- NOTE: first tag is [1], not [0]
        //        padata-type     [1] Int32,
        //        padata-value    [2] OCTET STRING -- might be encoded AP-REQ
        //}

        public PA_DATA()
        {
            // defaults for creation
            type  = Interop.PADATA_TYPE.PA_PAC_REQUEST;
            value = new KERB_PA_PAC_REQUEST();
        }