Beispiel #1
0
		static Samples() 
		{
			/// utcTime
			utcTime = new ASN1UTCTime();
			utcTime.Assign("0401291907+0100"); /// 29/01/2004, 19:07, CET
			utcTime.DecodeString();

			
			
			/// Name (X.501)
			name = new Name();

			try 
			{
				using(FileStream fs = new FileStream(@"test.X501.Name.01.ber", FileMode.Open)) 
				{
					BinaryReader br = new BinaryReader(fs);
					byte[] ber_bytes = br.ReadBytes((int)fs.Length);

					BEREncoding ber = new BEREncoding(ber_bytes);
					name.fromBER(ber);

					fs.Close();
				}
			}
			catch (System.Exception e)
			{
				Console.WriteLine(e.ToString());
				throw new Exception("Samples pallette failed at initializing .name!");
			}


			/// SubjectPublicKeyInfo subjectPKInfo
			subjectPKInfo = new SubjectPublicKeyInfo();
			//			ContentEncryptionAlgorithmIdentifier alg = new ContentEncryptionAlgorithmIdentifier();
			//			alg.Assign(PKCS7.CMS_AlgorithmIdentifiers.rsaEncryption, null);
			//			subjectPKInfo.Assign(alg, new ASN1BitString(new byte[]{0x1, 0x1, 0x1}, 19));
			

		}
Beispiel #2
0
		public void Test_Name ()
		{

			BEREncoding ber = BERReader.CreateBEREncoding("test.X501.Name.01.ber");
			BERWriter.DumpHEX(ber);
			Console.WriteLine(ber);

			Name name = new Name();
			name.fromBER(ber);



			


			
		}