Exemplo n.º 1
0
		/// <summary>
		/// Encode ASN.1 class members to specified buffer. 
		///
		/// NB Assinine ASN.1 DER encoding rules requires members be added in reverse order.
		/// </summary>
		/// <param name="Buffer">Output buffer</param>
        public override void Encode (Goedel.ASN1.Buffer Buffer) {
			int Position = Buffer.Encode__Sequence_Start ();

			Buffer.Encode__BigInteger  (Coefficient, 0, -1);
			Buffer.Debug ("Coefficient");

			Buffer.Encode__BigInteger  (Exponent2, 0, -1);
			Buffer.Debug ("Exponent2");

			Buffer.Encode__BigInteger  (Exponent1, 0, -1);
			Buffer.Debug ("Exponent1");

			Buffer.Encode__BigInteger  (Prime2, 0, -1);
			Buffer.Debug ("Prime2");

			Buffer.Encode__BigInteger  (Prime1, 0, -1);
			Buffer.Debug ("Prime1");

			Buffer.Encode__BigInteger  (PrivateExponent, 0, -1);
			Buffer.Debug ("PrivateExponent");

			Buffer.Encode__BigInteger  (PublicExponent, 0, -1);
			Buffer.Debug ("PublicExponent");

			Buffer.Encode__BigInteger  (Modulus, 0, -1);
			Buffer.Debug ("Modulus");

			Buffer.Encode__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Exemplo n.º 2
0
		/// <summary>
		/// Encode ASN.1 class members to specified buffer. 
		///
		/// NB Assinine ASN.1 DER encoding rules requires members be added in reverse order.
		/// </summary>
		/// <param name="Buffer">Output buffer</param>
        public override void Encode (Goedel.ASN1.Buffer Buffer) {
			int Position = Buffer.Encode__Sequence_Start ();

			if (CrlEntryExtensions == null || CrlEntryExtensions.Count == 0) {
				Buffer.Encode__Object (null, 6, -1);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.Extension  _Index in CrlEntryExtensions) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 6, -1);
			}
			Buffer.Debug ("CrlEntryExtensions");

			Buffer.Encode__Time  (RevocationDate, 0, -1);
			Buffer.Debug ("RevocationDate");

			Buffer.Encode__BigInteger  (UserCertificate, 0, -1);
			Buffer.Debug ("UserCertificate");
			Buffer.Encode__Sequence_End (Position);
            }
Exemplo n.º 3
0
		/// <summary>
		/// Encode ASN.1 class members to specified buffer. 
		///
		/// NB Assinine ASN.1 DER encoding rules requires members be added in reverse order.
		/// </summary>
		/// <param name="Buffer">Output buffer</param>
        public override void Encode (Goedel.ASN1.Buffer Buffer) {
			int Position = Buffer.Encode__Sequence_Start ();

			Buffer.Encode__BigInteger  (PublicExponent, 0, -1);
			Buffer.Debug ("PublicExponent");

			Buffer.Encode__BigInteger  (Modulus, 0, -1);
			Buffer.Debug ("Modulus");
			Buffer.Encode__Sequence_End (Position);
            }
Exemplo n.º 4
0
		/// <summary>
		/// Encode ASN.1 class members to specified buffer. 
		///
		/// NB Assinine ASN.1 DER encoding rules requires members be added in reverse order.
		/// </summary>
		/// <param name="Buffer">Output buffer</param>
        public override void Encode (Goedel.ASN1.Buffer Buffer) {
			int Position = Buffer.Encode__Sequence_Start ();

			if (Extensions == null || Extensions.Count == 0) {
				Buffer.Encode__Object (null, 6, 3);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.Extension  _Index in Extensions) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 6, 3);
			}
			Buffer.Debug ("Extensions");

			Buffer.Encode__Bits  (SubjectUniqueID, 5, 2);
			Buffer.Debug ("SubjectUniqueID");

			Buffer.Encode__Bits  (IssuerUniqueID, 5, 1);
			Buffer.Debug ("IssuerUniqueID");

			Buffer.Encode__Object (SubjectPublicKeyInfo, 0, -1);
			Buffer.Debug ("SubjectPublicKeyInfo");

			if (Subject == null || Subject.Count == 0) {
				Buffer.Encode__Object (null, 0, -1);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.Name  _Index in Subject) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 0, -1);
			}
			Buffer.Debug ("Subject");

			Buffer.Encode__Object (Validity, 0, -1);
			Buffer.Debug ("Validity");

			if (Issuer == null || Issuer.Count == 0) {
				Buffer.Encode__Object (null, 0, -1);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.Name  _Index in Issuer) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 0, -1);
			}
			Buffer.Debug ("Issuer");

			Buffer.Encode__Object (Signature, 0, -1);
			Buffer.Debug ("Signature");

			Buffer.Encode__BigInteger  (SerialNumber, 0, -1);
			Buffer.Debug ("SerialNumber");

			Buffer.Encode__Integer  (Version, 2, 0);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }