public KerberosFastResponse(KrbFastResponse fastResponse)
 {
     FastResponse = fastResponse;
     int len = fastResponse.padata.Elements.Length;
     PaData = new IPaData[len];
     for (int i = 0; i < len; i++)
     {
         PaData[i] = PaDataParser.ParseRepPaData(fastResponse.padata.Elements[i]);
     }
 }
 public void Decrypt(byte[] armorKey)
 {
     ArmorKey = armorKey;
     var decrypted = KerberosUtility.Decrypt(
         (Cryptographic.EncryptionType)EncFastRep.etype.Value,
         armorKey,
         EncFastRep.cipher.ByteArrayValue,
         (int)KeyUsageNumber.FAST_ENC);
     KrbFastResponse krbFastRep = new KrbFastResponse();
     krbFastRep.BerDecode(new Asn1DecodingBuffer(decrypted));
     FastRep = new KerberosFastResponse(krbFastRep);
 }
        public KerberosFastResponse GetKerberosFastRep(EncryptionKey key)
        {
            var armoredRep = GetArmoredRep();
            var decrypted = KerberosUtility.Decrypt((EncryptionType)key.keytype.Value ,
                key.keyvalue.ByteArrayValue,
                armoredRep.enc_fast_rep.cipher.ByteArrayValue,
                (int)KeyUsageNumber.FAST_REP
            );

            KerberosUtility.OnDumpMessage("KRB5:KrbFastArmoredRep(enc-fast-req)",
                "An encrypted KrbFastRep in PA_FX_FAST_REPLY",
                KerberosUtility.DumpLevel.PartialMessage,
                decrypted);

            KrbFastResponse fastrep = new KrbFastResponse();
            fastrep.BerDecode(new Asn1DecodingBuffer(decrypted));
            return new KerberosFastResponse(fastrep);
        }