/// <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); }
/// <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); }
/// <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); }
/// <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__Time (NotAfter, 0, -1); Buffer.Debug ("NotAfter"); Buffer.Encode__Time (NotBefore, 0, -1); Buffer.Debug ("NotBefore"); Buffer.Encode__Sequence_End (Position); }