Gurux DLMS/COSEM Transport security (Ciphering) settings.
상속: GXICipher
예제 #1
0
 public void CopyTo(GXCiphering target)
 {
     target.Security          = Security;
     target.InvocationCounter = InvocationCounter;
     target.SystemTitle       = SystemTitle;
     target.BlockCipherKey    = BlockCipherKey;
     target.AuthenticationKey = AuthenticationKey;
 }
예제 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="useLogicalNameReferencing">Is Logical or short name referencing used.</param>
 /// <param name="clientAddress">Client address. Default is 16 (0x10)</param>
 /// <param name="serverAddress">Server ID. Default is 1.</param>
 /// <param name="interfaceType">Interface type. Default is general.</param>
 public GXDLMSSecureNotify(bool useLogicalNameReferencing,
     int clientAddress, int serverAddress, InterfaceType interfaceType)
     : base(useLogicalNameReferencing,
         clientAddress, serverAddress, interfaceType)
 {
     Ciphering = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="useLogicalNameReferencing">Is Logical or short name referencing used.</param>
 /// <param name="clientAddress">Client address. Default is 16 (0x10)</param>
 /// <param name="serverAddress">Server ID. Default is 1.</param>
 /// <param name="interfaceType">Interface type. Default is general.</param>
 public GXDLMSSecureNotify(bool useLogicalNameReferencing,
                           int clientAddress, int serverAddress, InterfaceType interfaceType)
     : base(useLogicalNameReferencing,
            clientAddress, serverAddress, interfaceType)
 {
     Ciphering       = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="useLogicalNameReferencing">Is Logical or short name referencing used.</param>
 /// <param name="clientAddress">Client address. Default is 16 (0x10)</param>
 /// <param name="serverAddress">Server ID. Default is 1.</param>
 /// <param name="authentication">Authentication type. Default is None</param>
 /// <param name="password">Password if authentication is used.</param>
 /// <param name="interfaceType">Interface type. Default is general.</param>
 public GXDLMSSecureClient(bool useLogicalNameReferencing,
                           int clientAddress, int serverAddress, Authentication authentication,
                           string password, InterfaceType interfaceType) : base(useLogicalNameReferencing,
                                                                                clientAddress, serverAddress, authentication,
                                                                                password, interfaceType)
 {
     Ciphering       = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="useLogicalNameReferencing">Is Logical or short name referencing used.</param>
 /// <param name="clientAddress">Client address. Default is 16 (0x10)</param>
 /// <param name="serverAddress">Server ID. Default is 1.</param>
 /// <param name="authentication">Authentication type. Default is None</param>
 /// <param name="password">Password if authentication is used.</param>
 /// <param name="interfaceType">Interface type. Default is general.</param>
 public GXDLMSSecureClient(bool useLogicalNameReferencing,
                           int clientAddress, int serverAddress, Authentication authentication,
                           string password, InterfaceType interfaceType) : base(useLogicalNameReferencing,
                                   clientAddress, serverAddress, authentication,
                                   password, interfaceType)
 {
     Ciphering = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
 public void CopyTo(GXCiphering target)
 {
     target.Security          = Security;
     target.SecuritySuite     = SecuritySuite;
     target.InvocationCounter = InvocationCounter;
     target.SystemTitle       = SystemTitle;
     target.BlockCipherKey    = BlockCipherKey;
     target.AuthenticationKey = AuthenticationKey;
     if (PublicKeys != null)
     {
         target.PublicKeys.AddRange(PublicKeys);
     }
 }
        ///<summary>
        /// Constructor.
        ///</summary>
        ///<param name="sn">Short name settings. </param>
        ///<param name="type">
        /// Interface type.
        ///</param>
        ///<param name="flagID">
        /// Three letters FLAG ID.
        ///</param>
        ///<param name="serialNumber">
        /// Meter serial number. Size of serial number is 5 bytes.
        ///</param>
        public GXDLMSSecureServer(GXDLMSAssociationShortName sn, InterfaceType type, string flagID, UInt64 serialNumber) :
            base(sn, type)
        {
            if (flagID == null || flagID.Length != 3)
            {
                throw new ArgumentOutOfRangeException("Invalid FLAG ID.");
            }
            if (flagID == null || flagID.Length != 3)
            {
                throw new ArgumentOutOfRangeException("Invalid FLAG ID.");
            }
            GXByteBuffer bb = new GXByteBuffer();

            bb.Add(flagID);
            GXByteBuffer serial = new GXByteBuffer();

            serial.SetUInt64(serialNumber);
            bb.Set(serial.Data, 3, 5);
            Ciphering       = new GXCiphering(bb.Array());
            Settings.Cipher = Ciphering;
        }
예제 #8
0
        ///<summary>
        /// Constructor.
        ///</summary>
        ///<param name="ln">Logical name settings. </param>
        ///<param name="hdlc">
        /// Interface type.
        ///</param>
        ///<param name="flagID">
        /// Three letters FLAG ID.
        ///</param>
        ///<param name="serialNumber">
        /// Meter serial number. Size of serial number is 5 bytes.
        ///</param>
        public GXDLMSSecureServer(GXDLMSAssociationLogicalName ln, GXDLMSHdlcSetup hdlc, string flagID, UInt64 serialNumber) :
            base(ln, hdlc)
        {
            if (flagID == null || flagID.Length != 3)
            {
                throw new ArgumentOutOfRangeException("Invalid FLAG ID.");
            }
            if (flagID == null || flagID.Length != 3)
            {
                throw new ArgumentOutOfRangeException("Invalid FLAG ID.");
            }
            ln.XDLMSContextInfo.settings = Settings;
            GXByteBuffer bb = new GXByteBuffer();

            bb.Add(flagID);
            GXByteBuffer serial = new GXByteBuffer();

            serial.SetUInt64(serialNumber);
            bb.Set(serial.Data, 3, 5);
            Ciphering       = new GXCiphering(bb.Array());
            Settings.Cipher = Ciphering;
        }
 public GXDLMSSecureServer(bool logicalNameReferencing, InterfaceType type) :
     base(logicalNameReferencing, type)
 {
     Ciphering       = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #10
0
 ///<summary>
 /// Constructor.
 ///</summary>
 public GXDLMSSecureClient() : this(false)
 {
     Ciphering       = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #11
0
 ///<summary>
 /// Constructor.
 ///</summary>
 ///<param name="logicalNameReferencing">
 /// Is logical name referencing used.
 ///</param>
 ///<param name="type">
 /// Interface type.
 ///</param>
 public GXDLMSSecureServer(GXDLMSAssociationLogicalName ln, GXDLMSHdlcSetup hdlc) :
     base(ln, hdlc)
 {
     Ciphering       = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #12
0
 ///<summary>
 /// Constructor.
 ///</summary>
 public GXDLMSSecureClient() : base()
 {
     Ciphering = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }
예제 #13
0
 ///<summary>
 /// Constructor.
 ///</summary>
 ///<param name="logicalNameReferencing">
 /// Is logical name referencing used. 
 ///</param>
 ///<param name="type">
 /// Interface type. 
 ///</param>
 public GXDLMSSecureServer(bool logicalNameReferencing, InterfaceType type) :
     base(logicalNameReferencing, type)
 {
     Ciphering = new GXCiphering(ASCIIEncoding.ASCII.GetBytes("ABCDEFGH"));
     Settings.Cipher = Ciphering;
 }