From OpenSCADAWiki
(Importing a new version from external source) |
(Importing a new version from external source) |
||
Line 39: | Line 39: | ||
* ''static int asymmetricKeyLength( const string &keyCertPem );'' — Key length getting of the certificate ''keyCertPem''. | * ''static int asymmetricKeyLength( const string &keyCertPem );'' — Key length getting of the certificate ''keyCertPem''. | ||
* ''static string deriveKey( const string &secret, const string &seed, int keyLen );'' — Key of the length ''keyLen'' derive from the ''secret'' and the ''seed''. | * ''static string deriveKey( const string &secret, const string &seed, int keyLen );'' — Key of the length ''keyLen'' derive from the ''secret'' and the ''seed''. | ||
− | * ''static string | + | * ''static string symmetricCrypt( const string &mess, const string &keySet, const string &secPolicy, bool encrypt );'' — Symmetric encryption at ''encrypt'' or decryption of the message ''mess'' stream by the key ''keySet'' for the policy ''secPolicy''. |
− | + | ||
* ''static string symmetricSign( const string &mess, const string &keySet, const string &secPolicy );'' — Symmetric sign by key ''keySet'' getting for the message ''mess'' and the policy ''secPolicy''. | * ''static string symmetricSign( const string &mess, const string &keySet, const string &secPolicy );'' — Symmetric sign by key ''keySet'' getting for the message ''mess'' and the policy ''secPolicy''. |
Latest revision as of 09:15, 3 April 2025
Root object of the OPC-UA protocol (UA)
Public methods:
- virtual string lang2CodeSYS( ); — Two-symbol language code of the environment.
- virtual void debugMess( const string &mess ) — Debug messages placing.
- virtual uint32_t rcvBufSz( ); — Receiver buffer size, great for 8192.
- virtual uint32_t sndBufSz( ); — Transmitter buffer size, great for 8192.
- virtual uint32_t msgMaxSz( ); — Maximum message size, 0 for unlimited.
- virtual uint32_t chunkMaxCnt( ); — Maximum chunks counter, 0 for unlimited.
- static string iErr( const string &buf, int &off ); — Error reading from the stream buf by the offset off.
- static const char *iVal( const string &buf, int &off, char vSz ); — Value in size vSz reading from the stream buf by the offset off, as a data part.
- static int64_t iN( const string &rb, int &off, char vSz ); — Value of signed integer in size vSz (1, 2, 4, 8) reading from the stream rb by the offset off.
- static uint64_t iNu( const string &rb, int &off, char vSz ); — Value of unsigned integer in size vSz (1, 2, 4, 8) reading from the stream rb by the offset off.
- static double iR( const string &rb, int &off, char vSz = 4 ); — Value of real in size vSz (4, 8) reading from the stream rb by the offset off.
- static string iS( const string &buf, int &off ); — String reading from the stream buf by the offset off.
- static string iSl( const string &buf, int &off, string *locale = NULL ); — Localized locale string reading from the stream buf by the offset off.
- static string iSqlf( const string &buf, int &off, uint16_t *nsIdx = NULL ); — String with the qualify nsIdx reading from the stream buf by the offset off.
- static int64_t iTm( const string &buf, int &off ); — Time reading from the stream buf by the offset off, with conversion it to the UNIX epoch.
- static NodeId iNodeId( const string &buf, int &off ); — Node identifier reading from the stream buf by the offset off.
- static string iVariant( const string &buf, int &off, uint8_t *tp = NULL ); — Variant type reading from the stream buf by the offset off, returns the variant in string representing of type tp.
- static void iDataValue( const string &buf, int &off, XML_N &nVal ); — Complex value (structure DataValue) reading to nVal from the stream buf by the offset off.
- static void oN( string &buf, int64_t val, char sz, int off = -1 ); — Value of signed integer val in size sz (1, 2, 4, 8) writing to the stream buf by the offset off.
- static void oNu( string &buf, uint64_t val, char sz, int off = -1 ); — Value of unsigned integer val in size sz (1, 2, 4, 8) writing to the stream buf by the offset off.
- static void oR( string &buf, double val, char sz = 4 ); — Value of real val in size sz (4, 8) writing to the stream buf by the offset off.
- static void oS( string &buf, const string &val, int off = -1 ); — String val writing to the stream buf by the offset off.
- static void oSl( string &buf, const string &val, const string &locale = "" ); — Localized locale string val writing to the stream buf by the offset off.
- static void oSqlf( string &buf, const string &val, uint16_t nsIdx = 0 ); — String val with the qualify nsIdx writing to the stream buf by the offset off.
- static void oTm( string &buf, int64_t val ); — Time val (in the UNIX epoch) writing to the stream buf by the offset off.
- static void oNodeId( string &buf, const NodeId &val ); — Node identifier val writing to the stream buf by the offset off.
- static void oRef( string &buf, uint32_t resMask, const NodeId &nodeId, const NodeId &refTypeId, bool isForward, const string &name, uint32_t nodeClass, const NodeId &typeDef ); — Writing to the stream buf of browsing description (structure ReferenceDescription) for the result mask resMask, the node nodeId, the reference type refTypeId, the forward direction isForward, the name name, the node class nodeClass, the definition type typeDef.
- void oDataValue( string &buf, uint8_t eMsk, const string &vl, uint8_t vEMsk = 0, int64_t srcTmStmp = 0 ); — Complex value (structure DataValue) writing to the stream buf for the encoding mask eMsk, the value vl, the value mask vEMsk, the source time srcTmStmp.
- static string randBytes( int num ); — Random data stream generation in the number num.
- static string certPEM2DER( const string &certPem ); — Certificate conversion from PEM certPem to DER form.
- static string certDER2PEM( const string &certDer ); — Certificate conversion from DER certDer to PEM form.
- static string certThumbprint( const string &certPem ); — Sign getting from the certificate PEM certPem.
- static string asymmetricEncrypt( const string &mess, const string &certPem, const string &secPolicy ); — Asymmetric encryption of the message mess stream by the certificate certPem (by the open key) for the policy secPolicy.
- static string asymmetricDecrypt( const string &mess, const string &pvKeyPem, const string &secPolicy ); — Asymmetric decryption of the message mess stream by the key pvKeyPem for the certificate secPolicy.
- static bool asymmetricVerify( const string &mess, const string &sign, const string &certPem ); — Asymmetric verifying of the sign of the message mess by the certificate certPem.
- static string asymmetricSign( const string &mess, const string &pvPem ); — Asymmetric subscription getting by the private key of the certificate pvPem for the message mess.
- static int asymmetricKeyLength( const string &keyCertPem ); — Key length getting of the certificate keyCertPem.
- static string deriveKey( const string &secret, const string &seed, int keyLen ); — Key of the length keyLen derive from the secret and the seed.
- static string symmetricCrypt( const string &mess, const string &keySet, const string &secPolicy, bool encrypt ); — Symmetric encryption at encrypt or decryption of the message mess stream by the key keySet for the policy secPolicy.
- static string symmetricSign( const string &mess, const string &keySet, const string &secPolicy ); — Symmetric sign by key keySet getting for the message mess and the policy secPolicy.