// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: Global_Uconnect_Ext_Signature.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Com.Fca.Uconnect.Global {

  /// <summary>Holder for reflection information generated from Global_Uconnect_Ext_Signature.proto</summary>
  public static partial class GlobalUconnectExtSignatureReflection {

    #region Descriptor
    /// <summary>File descriptor for Global_Uconnect_Ext_Signature.proto</summary>
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static GlobalUconnectExtSignatureReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "CiNHbG9iYWxfVWNvbm5lY3RfRXh0X1NpZ25hdHVyZS5wcm90bxIXY29tLmZj",
            "YS51Y29ubmVjdC5nbG9iYWwifwoJU2lnbmF0dXJlEhMKC3NpZ25hdHVyZUlk",
            "GAEgASgFEhUKDXNpZ25hdHVyZVR5cGUYAiABKAkSFgoOc2lnbmF0dXJlVmFs",
            "dWUYAyABKAwSFAoMdW5zaWduZWREYXRhGAQgASgMEhgKEGNlcnRpZmljYXRl",
            "Q2hhaW4YBSADKAxiBnByb3RvMw=="));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { },
          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(global::Com.Fca.Uconnect.Global.Signature), global::Com.Fca.Uconnect.Global.Signature.Parser, new[]{ "SignatureId", "SignatureType", "SignatureValue", "UnsignedData", "CertificateChain" }, null, null, null)
          }));
    }
    #endregion

  }
  #region Messages
  /// <summary>
  ///*
  /// A Signature message may follow any message in the UconnectMessage messages array. The purpose of the signature message is to allow validation and protection of messages that are stored on the TU for more than a single transient invocation of the client application.
  /// Signature messages may contain direct hash function values, or may be interpreted otherwise per mutual arrangement between the TU and the SDP applications.
  /// &lt;div class=exmsg-main>
  /// &lt;h4>Signature Example Message:&lt;/h4>
  /// &lt;div class=ex-msg>
  ///	&lt;code>
  /// 		timestamp: 1489208951716
  /// 		messageId: 3
  /// 		messages
  /// 		{
  /// 		 [com.fca.uconnect.global.signature]
  /// 		 {
  /// 		  signatureId:11
  /// 		  signatureType: "RSA CERT"
  /// 		  signatureValue: "put x509 cert here"
  /// 		 }
  ///      }
  /// &lt;/code>
  /// &lt;/div>
  /// &lt;/div>
  /// </summary>
  public sealed partial class Signature : pb::IMessage<Signature> {
    private static readonly pb::MessageParser<Signature> _parser = new pb::MessageParser<Signature>(() => new Signature());
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pb::MessageParser<Signature> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Com.Fca.Uconnect.Global.GlobalUconnectExtSignatureReflection.Descriptor.MessageTypes[0]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Signature() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Signature(Signature other) : this() {
      signatureId_ = other.signatureId_;
      signatureType_ = other.signatureType_;
      signatureValue_ = other.signatureValue_;
      unsignedData_ = other.unsignedData_;
      certificateChain_ = other.certificateChain_.Clone();
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Signature Clone() {
      return new Signature(this);
    }

    /// <summary>Field number for the "signatureId" field.</summary>
    public const int SignatureIdFieldNumber = 1;
    private int signatureId_;
    /// <summary>
    //// The signatureId is used to correlate the message data with the signature.  This can support multiple messages with separate signatures as required.
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int SignatureId {
      get { return signatureId_; }
      set {
        signatureId_ = value;
      }
    }

    /// <summary>Field number for the "signatureType" field.</summary>
    public const int SignatureTypeFieldNumber = 2;
    private string signatureType_ = "";
    /// <summary>
    //// a well known identified that specifies the type of signature or hash. For example, SHA256.
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public string SignatureType {
      get { return signatureType_; }
      set {
        signatureType_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// <summary>Field number for the "signatureValue" field.</summary>
    public const int SignatureValueFieldNumber = 3;
    private pb::ByteString signatureValue_ = pb::ByteString.Empty;
    /// <summary>
    ////The signature value generated from by the Global PKI system for the associated message containing the matching signatureId.
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public pb::ByteString SignatureValue {
      get { return signatureValue_; }
      set {
        signatureValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// <summary>Field number for the "unsignedData" field.</summary>
    public const int UnsignedDataFieldNumber = 4;
    private pb::ByteString unsignedData_ = pb::ByteString.Empty;
    /// <summary>
    //// This is used as source data for signing.
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public pb::ByteString UnsignedData {
      get { return unsignedData_; }
      set {
        unsignedData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// <summary>Field number for the "certificateChain" field.</summary>
    public const int CertificateChainFieldNumber = 5;
    private static readonly pb::FieldCodec<pb::ByteString> _repeated_certificateChain_codec
        = pb::FieldCodec.ForBytes(42);
    private readonly pbc::RepeatedField<pb::ByteString> certificateChain_ = new pbc::RepeatedField<pb::ByteString>();
    /// <summary>
    ////This is used to return the whole chain of certificates used to sign the data
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public pbc::RepeatedField<pb::ByteString> CertificateChain {
      get { return certificateChain_; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override bool Equals(object other) {
      return Equals(other as Signature);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool Equals(Signature other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (SignatureId != other.SignatureId) return false;
      if (SignatureType != other.SignatureType) return false;
      if (SignatureValue != other.SignatureValue) return false;
      if (UnsignedData != other.UnsignedData) return false;
      if(!certificateChain_.Equals(other.certificateChain_)) return false;
      return true;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (SignatureId != 0) hash ^= SignatureId.GetHashCode();
      if (SignatureType.Length != 0) hash ^= SignatureType.GetHashCode();
      if (SignatureValue.Length != 0) hash ^= SignatureValue.GetHashCode();
      if (UnsignedData.Length != 0) hash ^= UnsignedData.GetHashCode();
      hash ^= certificateChain_.GetHashCode();
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void WriteTo(pb::CodedOutputStream output) {
      if (SignatureId != 0) {
        output.WriteRawTag(8);
        output.WriteInt32(SignatureId);
      }
      if (SignatureType.Length != 0) {
        output.WriteRawTag(18);
        output.WriteString(SignatureType);
      }
      if (SignatureValue.Length != 0) {
        output.WriteRawTag(26);
        output.WriteBytes(SignatureValue);
      }
      if (UnsignedData.Length != 0) {
        output.WriteRawTag(34);
        output.WriteBytes(UnsignedData);
      }
      certificateChain_.WriteTo(output, _repeated_certificateChain_codec);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (SignatureId != 0) {
        size += 1 + pb::CodedOutputStream.ComputeInt32Size(SignatureId);
      }
      if (SignatureType.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(SignatureType);
      }
      if (SignatureValue.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeBytesSize(SignatureValue);
      }
      if (UnsignedData.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeBytesSize(UnsignedData);
      }
      size += certificateChain_.CalculateSize(_repeated_certificateChain_codec);
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(Signature other) {
      if (other == null) {
        return;
      }
      if (other.SignatureId != 0) {
        SignatureId = other.SignatureId;
      }
      if (other.SignatureType.Length != 0) {
        SignatureType = other.SignatureType;
      }
      if (other.SignatureValue.Length != 0) {
        SignatureValue = other.SignatureValue;
      }
      if (other.UnsignedData.Length != 0) {
        UnsignedData = other.UnsignedData;
      }
      certificateChain_.Add(other.certificateChain_);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 8: {
            SignatureId = input.ReadInt32();
            break;
          }
          case 18: {
            SignatureType = input.ReadString();
            break;
          }
          case 26: {
            SignatureValue = input.ReadBytes();
            break;
          }
          case 34: {
            UnsignedData = input.ReadBytes();
            break;
          }
          case 42: {
            certificateChain_.AddEntriesFrom(input, _repeated_certificateChain_codec);
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code
