Пример #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 ();

			if (Extensions == null || Extensions.Count == 0) {
				Buffer.Encode__Object (null, 0, -1);
				}
			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, 0, -1);
			}
			Buffer.Debug ("Extensions");

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

			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__Octets  (SubjectKeyIdentifier, 0, -1);
			Buffer.Debug ("SubjectKeyIdentifier");

			Buffer.Encode__Octets  (IssuerKeyIdentifier, 0, -1);
			Buffer.Debug ("IssuerKeyIdentifier");

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

			Buffer.Encode__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #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 (Attributes == null || Attributes.Count == 0) {
				Buffer.Encode__Object (null, 1, 0);
				}
			else {
				int XPosition = Buffer.Encode__Set_Start();
				foreach (Goedel.Cryptography.PKIX.AttributeTypeValues  _Index in Attributes) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Set_End(XPosition, 1, 0);
			}
			Buffer.Debug ("Attributes");

			Buffer.Encode__Octets  (PrivateKey, 0, -1);
			Buffer.Debug ("PrivateKey");

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

			Buffer.Encode__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #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  (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);
            }
Пример #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 ();

			// Default is 1
			if (Iterations != 1) {
				Buffer.Encode__Integer (Iterations, 0, -1);
				}
			Buffer.Debug ("Iterations");

			Buffer.Encode__Octets  (MacSalt, 0, -1);
			Buffer.Debug ("MacSalt");

			Buffer.Encode__Object (MAC, 0, -1);
			Buffer.Debug ("MAC");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #5
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__Object (EncryptedContent, 0, -1);
			Buffer.Debug ("EncryptedContent");

			Buffer.Encode__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #6
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__Integer  (Maximum, 0, 1);
			Buffer.Debug ("Maximum");

			Buffer.Encode__Integer  (Minimum, 0, 0);
			Buffer.Debug ("Minimum");

			Buffer.Encode__Object (Base, 0, -1);
			Buffer.Debug ("Base");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #7
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__Object (MacData, 4, -1);
			Buffer.Debug ("MacData");

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

			Buffer.Encode__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #8
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__Integer  (PathLenConstraint, 4, -1);

			// Default is false
			if (CA != false) {
				Buffer.Encode__Boolean (CA, 0, -1);
				}
			Buffer.Encode__Sequence_End (Position);
            }
Пример #9
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__Integer  (AuthorityCertSerialNumber, 12, 2);

			if (AuthorityCertIssuer == null || AuthorityCertIssuer.Count == 0) {
				Buffer.Encode__Object (null, 12, 1);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.GeneralName  _Index in AuthorityCertIssuer) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 12, 1);
			}

			Buffer.Encode__Octets  (KeyIdentifier, 12, 0);
			Buffer.Encode__Sequence_End (Position);
            }
Пример #10
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 (Attributes == null || Attributes.Count == 0) {
				Buffer.Encode__Object (null, 1, 0);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.AttributeTypeValues  _Index in Attributes) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 1, 0);
			}
			Buffer.Debug ("Attributes");

			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__Integer  (Version, 0, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #11
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 (CrlExtensions == null || CrlExtensions.Count == 0) {
				Buffer.Encode__Object (null, 2, 0);
				}
			else {
				int XPosition = Buffer.Encode__Sequence_Start();
				foreach (Goedel.Cryptography.PKIX.Extension  _Index in CrlExtensions) {
		
			Buffer.Encode__Object (_Index, 0, 0);
					}
				Buffer.Encode__Sequence_End(XPosition, 2, 0);
			}
			Buffer.Debug ("CrlExtensions");

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

			Buffer.Encode__Time  (NextUpdate, 4, -1);
			Buffer.Debug ("NextUpdate");

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

			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__Integer  (Version, 4, -1);
			Buffer.Debug ("Version");
			Buffer.Encode__Sequence_End (Position);
            }
Пример #12
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);
            }