public void Decrypt(byte[] key)
 {
     var encryptType = (EncryptionType)Response.enc_part.etype.Value;
     var decoded = KerberosUtility.Decrypt(
         encryptType,
         key,
         Response.enc_part.cipher.ByteArrayValue,
         (int)KeyUsageNumber.AP_REP_EncAPRepPart);
     KerberosUtility.OnDumpMessage("KRB5:PA-ENC-TS-ENC",
         "Encrypted Timestamp Pre-authentication",
         KerberosUtility.DumpLevel.PartialMessage,
         decoded);
     ApEncPart = new EncAPRepPart();
     ApEncPart.BerDecode(new Asn1DecodingBuffer(decoded));
     KerberosUtility.OnDumpMessage("KRB5:AP-REP(enc-part)",
         "Encrypted part of AS-REP",
         KerberosUtility.DumpLevel.PartialMessage,
         decoded);
 }
예제 #2
0
        public KerberosApResponse CreateApResponse(EncryptionKey subkey)
        {
            var response = new KerberosApResponse();

            response.Response.msg_type = new Asn1Integer((int)MsgType.KRB_AP_RESP);
            response.Response.pvno     = new Asn1Integer(KerberosConstValue.KERBEROSV5);

            // Set EncAPRepPart
            var apEncPart = new EncAPRepPart();

            apEncPart.ctime      = Context.Time;
            apEncPart.cusec      = Context.Cusec;
            apEncPart.subkey     = null;
            apEncPart.seq_number = new KerbUInt32((long)Context.currentRemoteSequenceNumber);
            response.ApEncPart   = apEncPart;

            this.client.UpdateContext(response);
            return(response);
        }
        public void Decrypt(byte[] key)
        {
            var encryptType = (EncryptionType)Response.enc_part.etype.Value;
            var decoded     = KerberosUtility.Decrypt(
                encryptType,
                key,
                Response.enc_part.cipher.ByteArrayValue,
                (int)KeyUsageNumber.AP_REP_EncAPRepPart);

            KerberosUtility.OnDumpMessage("KRB5:PA-ENC-TS-ENC",
                                          "Encrypted Timestamp Pre-authentication",
                                          KerberosUtility.DumpLevel.PartialMessage,
                                          decoded);
            ApEncPart = new EncAPRepPart();
            ApEncPart.BerDecode(new Asn1DecodingBuffer(decoded));
            KerberosUtility.OnDumpMessage("KRB5:AP-REP(enc-part)",
                                          "Encrypted part of AS-REP",
                                          KerberosUtility.DumpLevel.PartialMessage,
                                          decoded);
        }