/// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomQRCodeIdentificationSerializer">A delegate to serialize custom QR code identification JSON objects.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <QRCodeIdentification> CustomQRCodeIdentificationSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("EvcoID", EVCOId.ToString()),

                PIN.IsNotNullOrEmpty()

                               ? Function == PINCrypto.None

                                     ? new JProperty("PIN", PIN)

                                     : new JProperty("HashedPIN", JSONObject.Create(
                                                         new JProperty("Value", PIN),
                                                         new JProperty("Function", Function.AsString()),
                                                         new JProperty("Salt", Salt)
                                                         ))

                               : null

                );

            return(CustomQRCodeIdentificationSerializer != null
                       ? CustomQRCodeIdentificationSerializer(this, JSON)
                       : JSON);
        }
        /// <summary>
        /// Return a text-representation of this object.
        /// </summary>
        public override String ToString()

        => String.Concat(EVCOId.ToString(),
                         Function != PINCrypto.None
                                 ? String.Concat(" -", Function.AsString(), "-> ",
                                                 PIN,
                                                 Salt.IsNotNullOrEmpty() ? " (" + Salt + ")" : "")
                                 : PIN);
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="XName">The XML name to use.</param>
        public XElement ToXML(XName XName = null)

        => new XElement(XName ?? OICPNS.CommonTypes + "QRCodeIdentification",

                        new XElement(OICPNS.CommonTypes + "EvcoID", EVCOId.ToString()),

                        Function == PINCrypto.None

                       ? new XElement(OICPNS.CommonTypes + "PIN", PIN)

                       : new XElement(OICPNS.CommonTypes + "HashedPIN",
                                      new XElement(OICPNS.CommonTypes + "Value", PIN),
                                      new XElement(OICPNS.CommonTypes + "Function", Function.AsString()),
                                      new XElement(OICPNS.CommonTypes + "Salt", Salt))

                        );
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomQRCodeIdentificationSerializer">A delegate to serialize custom QR code identification JSON objects.</param>
        /// <param name="CustomHashedPINSerializer">A delegate to serialize custom QR code identification JSON objects.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <QRCodeIdentification> CustomQRCodeIdentificationSerializer = null,
                              CustomJObjectSerializerDelegate <HashedPIN> CustomHashedPINSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("EvcoID", EVCOId.ToString()),

                HashedPIN.HasValue
                               ? new JProperty("HashedPIN", HashedPIN.Value.ToJSON(CustomHashedPINSerializer))
                               : null,

                PIN.HasValue
                               ? new JProperty("PIN", PIN.Value.ToString())
                               : null

                );

            return(CustomQRCodeIdentificationSerializer != null
                       ? CustomQRCodeIdentificationSerializer(this, JSON)
                       : JSON);
        }
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="XName">The XML name to use.</param>
        public XElement ToXML(XName XName = null)

        => new XElement(XName ?? OICPNS.CommonTypes + "RFIDIdentification",

                        new XElement(OICPNS.CommonTypes + "UID", UID.ToString()),

                        EVCOId.HasValue
                       ? new XElement(OICPNS.CommonTypes + "EvcoID", EVCOId.ToString())
                       : null,

                        new XElement(OICPNS.CommonTypes + "RFIDType", RFIDType.ToString()),

                        PrintedNumber.IsNeitherNullNorEmpty()
                       ? new XElement(OICPNS.CommonTypes + "PrintedNumber", PrintedNumber)
                       : null,

                        ExpiryDate.HasValue
                       ? new XElement(OICPNS.CommonTypes + "ExpiryDate", ExpiryDate.ToString())
                       : null

                        );
        /// <summary>
        /// Return a JSON representation of this object.
        /// </summary>
        /// <param name="CustomRFIDIdentificationSerializer">A delegate to serialize custom RFID identification JSON objects.</param>
        public JObject ToJSON(CustomJObjectSerializerDelegate <RFIDIdentification> CustomRFIDIdentificationSerializer = null)
        {
            var JSON = JSONObject.Create(

                new JProperty("UID", UID.ToString()),

                EVCOId.HasValue
                               ? new JProperty("EvcoID", EVCOId.ToString())
                               : null,

                new JProperty("RFIDType", RFIDType.ToString()),

                PrintedNumber.IsNeitherNullNorEmpty()
                               ? new JProperty("PrintedNumber", PrintedNumber)
                               : null,

                ExpiryDate.HasValue
                               ? new JProperty("ExpiryDate", ExpiryDate.ToString())
                               : null);

            return(CustomRFIDIdentificationSerializer != null
                       ? CustomRFIDIdentificationSerializer(this, JSON)
                       : JSON);
        }