Beispiel #1
0
        // internal AND protected
        internal override GpgInterfaceResult ProcessLine(String line)
        {
            if (!GNUCheck(ref line))
                return GpgInterfaceResult.Success;

            switch (GetKeyword(ref line))
            {
                case GpgKeyword.NODATA:
                    return new GpgInterfaceResult(GpgInterfaceStatus.Error, GpgInterfaceMessage.DataError);

                case GpgKeyword.IMPORT_OK:
                {
                    String[] parts = line.Split(new Char[] { ' ' });

                    Int32 flag = Int32.Parse(parts[0], CultureInfo.InvariantCulture);
                    FingerPrint = new FingerPrint(parts[1]);

                    if (flag == 0)
                        Import = Import.Unchanged;
                    if ((flag & 1) == 1)
                        Import |= Import.NewKey;
                    if ((flag & 2) == 2)
                        Import |= Import.NewUserIds;
                    if ((flag & 4) == 4)
                        Import |= Import.NewSignatures;
                    if ((flag & 8) == 8)
                        Import |= Import.NewSubKeys;
                    if ((flag & 16) == 16)
                        Import |= Import.ContainsPrivateKey;

                    break;
                }
            }

            return GpgInterfaceResult.Success;
        }
Beispiel #2
0
		private static void SaveFingerPrint(String destFileName, FingerPrint fingerPrint)
		{
			String fingerPrintFileName = FileDownloader.MakeFingerPrintFilePath(destFileName);

			SecurityElement finger_print = new SecurityElement("finger_print");

			finger_print.AddAttribute("time_stamp", fingerPrint.timeStamp);
			finger_print.AddAttribute("file_size", fingerPrint.fileSize.ToString());

			File.WriteAllText(fingerPrintFileName, finger_print.ToString());
		}