CryptoStorePrivateKey (FUN) ¶ FUNCTION CryptoStorePrivateKey : RTS_IEC_RESULT This function can be used to store a private key that was imported or generated within the components internal data store. InOut: Scope Name Type Comment Return CryptoStorePrivateKey RTS_IEC_RESULT Result of the operation Input key RtsCryptoKey The private key to be stored. pKeyIdentifier POINTER TO RtsByteString A bytestring where the key identifier is stored. This identifier can be used to access the key later. The identifier does not contain any sensitive data.
Functions ¶ CryptoGenerateRandomNumber (Function) CryptoGetAlgorithmById (Function) CryptoGetFirstAlgorithm (Function) CryptoGetNextAlgorithm (Function) CryptoRtsByteStringExit (Function) CryptoRtsByteStringInit (Function) CryptoRtsByteStringInit2 (Function)
CryptoGenerateRandomNumber (FUN) ¶ FUNCTION CryptoGenerateRandomNumber : RTS_IEC_RESULT Generate a number of cryptographic strong bytes. InOut: Scope Name Type Comment Return CryptoGenerateRandomNumber RTS_IEC_RESULT Function returns ERR_OK if the bytes could be generated Input ui32NumOfRandomBytes UDINT Number of bytes needed. pRandom POINTER TO RtsByteString Buffer to store the bytes.
CryptoGetAlgorithmById (FUN) ¶ FUNCTION CryptoGetAlgorithmById : RTS_IEC_HANDLE Get a handle to the algorithm using a specific ID InOut: Scope Name Type Comment Return CryptoGetAlgorithmById RTS_IEC_HANDLE Handle to the crypto algorithm Input ui32CryptoID RtsCryptoID ID of the algorthm pResult POINTER TO RTS_IEC_RESULT Result of the operation. Can be NULL.
CryptoGetFirstAlgorithm (FUN) ¶ FUNCTION CryptoGetFirstAlgorithm : RTS_IEC_HANDLE Get the first algorthm matching the type given. Use this with the GetNext function to iterate over algorthmes of a specific type. InOut: Scope Name Type Comment Return CryptoGetFirstAlgorithm RTS_IEC_HANDLE Handle to the crypto algorithm Input ui32CryptoType RtsCryptoType Type of the algorithm. See: Crypto Types pszName POINTER TO STRING Name of the algorthm. Can be NULL. i32MaxNameLen DINT Maximum length of the name buffer pui32CryptoID POINTER TO RtsCryptoID ID of the algorithm. pResult POINTER TO RTS_IEC_RESULT Result of the operation. Can be NULL.
CryptoGetNextAlgorithm (FUN) ¶ FUNCTION CryptoGetNextAlgorithm : RTS_IEC_HANDLE Get the next algorthm matching the type given. InOut: Scope Name Type Comment Return CryptoGetNextAlgorithm RTS_IEC_HANDLE Handle to the crypto algorithm Input hCrypto RTS_IEC_HANDLE Handle to the last algorithem. ui32CryptoType RtsCryptoType Handle to the last algorithem. pszName POINTER TO STRING Name of the agorithm. Can be NULL. i32MaxNameLen DINT Maximum length of the name buffer pui32CryptoID POINTER TO RtsCryptoID ID of the agorithm. pResult POINTER TO RTS_IEC_RESULT Result of the operation. Can be NULL.
CryptoRtsByteStringExit (FUN) ¶ FUNCTION CryptoRtsByteStringExit : RTS_IEC_RESULT InOut: Scope Name Type Return CryptoRtsByteStringExit RTS_IEC_RESULT Input pByteString POINTER TO RtsByteString
CryptoRtsByteStringInit (FUN) ¶ FUNCTION CryptoRtsByteStringInit : RTS_IEC_RESULT InOut: Scope Name Type Return CryptoRtsByteStringInit RTS_IEC_RESULT Input pByteString POINTER TO RtsByteString
CryptoRtsByteStringInit2 (FUN) ¶ FUNCTION CryptoRtsByteStringInit2 : RTS_IEC_RESULT Initialize a byte string. InOut: Scope Name Type Comment Return CryptoRtsByteStringInit2 RTS_IEC_RESULT Input pByteString POINTER TO RtsByteString Pointer to the RtsByteString to be initialized. ui32BufferSize UDINT Buffersize needed for this byte string. pBuffer POINTER TO BYTE Pointer to a optional static buffer. If NULL is passed the function will allocated ui32BufferSize bytes from the heap. xEmptyBuffer BOOL Used for static buffers. If FALSE pByteString->ui32Lenght will be set to ui32BufferSize. Must be TRUE if pBuffer == NULL
Key Derivation ¶ CryptoDeriveKey (Function)