protected override void ProcessInternal(CustomBinaryReader reader) { serialNumber = reader.ReadSInt32(); // BCD coding of Month (two digits) and Year (two last digits) uint monthYear = reader.ReadBCDString(2); type = reader.ReadByte(); manufacturerCode = reader.ReadByte(); month = (byte)(monthYear / 100); year = (byte)(monthYear % 100); }
protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer) { serialNumber = reader.ReadSInt32(); month = reader.ReadByte(); year = reader.ReadByte(); type = reader.ReadByte(); manufacturerCode = reader.ReadByte(); writer.WriteAttributeString("Month", month.ToString()); writer.WriteAttributeString("Year", year.ToString()); writer.WriteAttributeString("Type", type.ToString()); writer.WriteAttributeString("ManufacturerCode", manufacturerCode.ToString()); writer.WriteString(serialNumber.ToString()); }
protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer) { serialNumber = reader.ReadSInt32(); // BCD coding of Month (two digits) and Year (two last digits) uint monthYear = reader.ReadBCDString(2); type = reader.ReadByte(); manufacturerCode = reader.ReadByte(); month = (byte)(monthYear / 100); year = (byte)(monthYear % 100); writer.WriteAttributeString("Month", month.ToString()); writer.WriteAttributeString("Year", year.ToString()); writer.WriteAttributeString("Type", type.ToString()); writer.WriteAttributeString("ManufacturerCode", manufacturerCode.ToString()); writer.WriteString(serialNumber.ToString()); }
public CertificateGen1(byte[] certificateData) { using (var reader = new CustomBinaryReader(new MemoryStream(certificateData))) { this.profileIdentifier = Convert.ToInt32(reader.ReadByte()); this.certificationAuthorityReference = new CertificationAuthorityReference(reader); this.holderAuthorisation = reader.ReadBytes(7); var timestamp = reader.ReadSInt32(); if (timestamp != 0xFFFFFFFF) { this.endOfValidity = DateTimeOffset.FromUnixTimeSeconds(timestamp); } else { this.endOfValidity = null; }; this.holderReference = reader.ReadBytes(8); this.publicKey = new RSAPublicKey(reader); }; }
protected override void ProcessInternal(CustomBinaryReader reader, XmlWriter writer) { serialNumber=reader.ReadSInt32(); month=reader.ReadByte(); year=reader.ReadByte(); type=reader.ReadByte(); manufacturerCode=reader.ReadByte(); writer.WriteAttributeString("Month", month.ToString()); writer.WriteAttributeString("Year", year.ToString()); writer.WriteAttributeString("Type", type.ToString()); writer.WriteAttributeString("ManufacturerCode", manufacturerCode.ToString()); writer.WriteString(serialNumber.ToString()); }