S2OPC OPCUA Toolkit
sopc_crypto_provider.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
26 #ifndef SOPC_CRYPTO_PROVIDER_H_
27 #define SOPC_CRYPTO_PROVIDER_H_
28 
29 #include "sopc_crypto_decl.h"
30 #include "sopc_key_manager.h"
31 #include "sopc_key_sets.h"
32 #include "sopc_pki.h"
33 #include "sopc_secret_buffer.h"
34 #include "sopc_types.h"
35 
36 #include "sopc_enums.h"
37 
47 {
67 };
68 
69 /* ------------------------------------------------------------------------------------------------
70  * CryptoProvider
71  * ------------------------------------------------------------------------------------------------
72  */
73 
89 
105 
112 
121 
130 
137 
144 
145 /* ------------------------------------------------------------------------------------------------
146  * CryptoProvider get-length & uris operations
147  * ------------------------------------------------------------------------------------------------
148  */
149 
165  uint32_t* pLength);
166 
183  uint32_t lengthIn,
184  uint32_t* pLengthOut);
185 
202  uint32_t lengthIn,
203  uint32_t* pLengthOut);
204 
220  uint32_t* pLength);
221 
235  uint32_t* pLength);
236 
258  uint32_t* pCipherTextBlockSize,
259  uint32_t* pPlainTextBlockSize);
260 
274  uint32_t* pLenNonce);
275 
293  uint32_t* pSymmCryptoKeyLength,
294  uint32_t* pSymmSignKeyLength,
295  uint32_t* pSymmInitVectorLength);
296 
316  const SOPC_AsymmetricKey* pKey,
317  uint32_t* pLenKeyBits);
318 
336  const SOPC_AsymmetricKey* pKey,
337  uint32_t* pLenKeyBytes);
338 
347  uint32_t* length);
348 
357  uint32_t* length);
358 
378  const SOPC_AsymmetricKey* pKey,
379  uint32_t* pCipherTextBlockSize,
380  uint32_t* pPlainTextBlockSize);
381 
399  const SOPC_AsymmetricKey* pKey,
400  uint32_t* pLenMsg);
401 
418  const SOPC_AsymmetricKey* pKey,
419  uint32_t* pLenMsg);
420 
438  const SOPC_AsymmetricKey* pKey,
439  uint32_t lengthIn,
440  uint32_t* pLengthOut);
441 
460  const SOPC_AsymmetricKey* pKey,
461  uint32_t lengthIn,
462  uint32_t* pLengthOut);
463 
480  const SOPC_AsymmetricKey* pKey,
481  uint32_t* pLength);
482 
493 
507  uint32_t* pLength);
508 
525 
542  uint32_t* pLength);
543 
544 /* ------------------------------------------------------------------------------------------------
545  * Symmetric cryptography
546  * ------------------------------------------------------------------------------------------------
547  */
548 
577  const uint8_t* pInput,
578  uint32_t lenPlainText,
579  SOPC_SecretBuffer* pKey,
580  SOPC_SecretBuffer* pIV,
581  uint8_t* pOutput,
582  uint32_t lenOutput);
583 
614  const uint8_t* pInput,
615  uint32_t lenCipherText,
616  SOPC_SecretBuffer* pKey,
617  SOPC_SecretBuffer* pIV,
618  uint8_t* pOutput,
619  uint32_t lenOutput);
620 
654  const uint8_t* pInput,
655  uint32_t lenInput,
656  SOPC_SecretBuffer* pKey,
657  SOPC_SecretBuffer* pKeyNonce,
658  const SOPC_ExposedBuffer* pRandom,
659  uint32_t lenRandom,
660  uint32_t uSequenceNumber,
661  uint8_t* pOutput,
662  uint32_t lenOutput);
663 
691  const uint8_t* pInput,
692  uint32_t lenInput,
693  SOPC_SecretBuffer* pKey,
694  uint8_t* pOutput,
695  uint32_t lenOutput);
696 
725  const uint8_t* pInput,
726  uint32_t lenInput,
727  SOPC_SecretBuffer* pKey,
728  const uint8_t* pSignature,
729  uint32_t lenOutput);
730 
731 /* ------------------------------------------------------------------------------------------------
732  * Random and pseudo-random functionalities
733  * ------------------------------------------------------------------------------------------------
734  */
735 
758  uint32_t nBytes,
759  SOPC_ExposedBuffer** ppBuffer);
760 
780  SOPC_SecretBuffer** ppNonce);
781 
797 
807  const SOPC_ExposedBuffer* pSecret,
808  uint32_t lenSecret,
809  const SOPC_ExposedBuffer* pSeed,
810  uint32_t lenSeed,
811  SOPC_ExposedBuffer* pOutput,
812  uint32_t lenOutput);
813 
839  const SOPC_ExposedBuffer* pClientNonce,
840  uint32_t lenClientNonce,
841  const SOPC_ExposedBuffer* pServerNonce,
842  uint32_t lenServerNonce,
843  SOPC_SC_SecurityKeySet* pClientKeySet,
844  SOPC_SC_SecurityKeySet* pServerKeySet);
845 
869  SOPC_SecretBuffer* pClientNonce,
870  const SOPC_ExposedBuffer* pServerNonce,
871  uint32_t lenServerNonce,
872  SOPC_SC_SecurityKeySet* pClientKeySet,
873  SOPC_SC_SecurityKeySet* pServerKeySet);
874 
898  const SOPC_ExposedBuffer* pClientNonce,
899  uint32_t lenClientNonce,
900  SOPC_SecretBuffer* pServerNonce,
901  SOPC_SC_SecurityKeySet* pClientKeySet,
902  SOPC_SC_SecurityKeySet* pServerKeySet);
903 
904 /* ------------------------------------------------------------------------------------------------
905  * Asymmetric cryptography
906  * ------------------------------------------------------------------------------------------------
907  */
908 
940  const uint8_t* pInput,
941  uint32_t lenInput,
942  const SOPC_AsymmetricKey* pKey,
943  uint8_t* pOutput,
944  uint32_t lenOutput,
945  const char** errorReason);
946 
980  const uint8_t* pInput,
981  uint32_t lenInput,
982  const SOPC_AsymmetricKey* pKey,
983  uint8_t* pOutput,
984  uint32_t lenOutput,
985  uint32_t* pLenWritten,
986  const char** errorReason);
987 
1025  const uint8_t* pInput,
1026  uint32_t lenInput,
1027  const SOPC_AsymmetricKey* pKeyPrivateLocal,
1028  uint8_t* pSignature,
1029  uint32_t lenSignature,
1030  const char** errorReason);
1031 
1065  const uint8_t* pInput,
1066  uint32_t lenInput,
1067  const SOPC_AsymmetricKey* pKeyRemotePublic,
1068  const uint8_t* pSignature,
1069  uint32_t lenSignature,
1070  const char** errorReason);
1071 
1072 /* ------------------------------------------------------------------------------------------------
1073  * Certificate validation
1074  * ------------------------------------------------------------------------------------------------
1075  */
1076 
1101  const SOPC_PKIProvider* pPKI,
1102  const SOPC_CertificateList* pCert,
1103  uint32_t* error);
1104 
1105 #endif /* SOPC_CRYPTO_PROVIDER_H_ */
SOPC_CryptoProvider_PubSubGetLength_MessageRandom
SOPC_ReturnStatus SOPC_CryptoProvider_PubSubGetLength_MessageRandom(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Writes the length in bytes in pLength of the random bytes used for PubSub encryption/decryption.
SOPC_CryptoProvider_GetProfileServices
const SOPC_CryptoProfile * SOPC_CryptoProvider_GetProfileServices(const SOPC_CryptoProvider *pProvider)
Returns the non NULL client-server crypto profile but returns NULL if the PubSub profile is non NULL.
sopc_types.h
SOPC_CryptoProvider_DeriveGetLengths
SOPC_ReturnStatus SOPC_CryptoProvider_DeriveGetLengths(const SOPC_CryptoProvider *pProvider, uint32_t *pSymmCryptoKeyLength, uint32_t *pSymmSignKeyLength, uint32_t *pSymmInitVectorLength)
Provides the lengths in bytes of the secrets derived from the nonce exchange.
sopc_pki.h
Defines the common interface that a PKI should provide. This is a minimal interface,...
SOPC_CryptoProvider_AsymmetricGetLength_MsgCipherText
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_MsgCipherText(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pLenMsg)
Provides the length in bytes of a ciphered message to be decrypted with a single asymmetric decryptio...
SOPC_CryptoProvider::pCryptolibContext
SOPC_CryptolibContext * pCryptolibContext
Definition: sopc_crypto_provider.h:66
SOPC_CryptoProvider_DeriveKeySets
SOPC_ReturnStatus SOPC_CryptoProvider_DeriveKeySets(const SOPC_CryptoProvider *pProvider, const SOPC_ExposedBuffer *pClientNonce, uint32_t lenClientNonce, const SOPC_ExposedBuffer *pServerNonce, uint32_t lenServerNonce, SOPC_SC_SecurityKeySet *pClientKeySet, SOPC_SC_SecurityKeySet *pServerKeySet)
Derive pseudo-random key sets from the randomly generated and shared secrets.
SOPC_CryptoProvider_GetProfilePubSub
const SOPC_CryptoProfile_PubSub * SOPC_CryptoProvider_GetProfilePubSub(const SOPC_CryptoProvider *pProvider)
Returns the non NULL PubSub crypto profile but returns NULL if the client-server profile is non NULL.
SOPC_CertificateList
The signed public key representation, or a chained list of such keys.
Definition: key_manager_lib.h:66
SOPC_CryptoProvider_AsymmetricEncrypt
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricEncrypt(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput, uint32_t lenOutput, const char **errorReason)
Encrypts a payload pInput of lenInput bytes.
SOPC_PKIProvider
The PKIProvider object defines the common interface for the Public Key Infrastructure.
Definition: sopc_pki.h:71
SOPC_CryptoProvider::pProfilePubSub
const SOPC_CryptoProfile_PubSub *const pProfilePubSub
Definition: sopc_crypto_provider.h:61
sopc_key_manager.h
The SOPC_KeyManager provides an API for Asymmetric Key Management such as loading signed public keys ...
SOPC_CryptoProvider_Create
SOPC_CryptoProvider * SOPC_CryptoProvider_Create(const char *uri)
Creates an initialized SOPC_CryptoProvider context for a client-server connection from a string conta...
SOPC_CryptoProvider_DerivePseudoRandomData
SOPC_ReturnStatus SOPC_CryptoProvider_DerivePseudoRandomData(const SOPC_CryptoProvider *pProvider, const SOPC_ExposedBuffer *pSecret, uint32_t lenSecret, const SOPC_ExposedBuffer *pSeed, uint32_t lenSeed, SOPC_ExposedBuffer *pOutput, uint32_t lenOutput)
Derives pseudo-random data from the randomly generated and shared secrets.
SOPC_CryptoProvider_GenerateRandomID
SOPC_ReturnStatus SOPC_CryptoProvider_GenerateRandomID(const SOPC_CryptoProvider *pProvider, uint32_t *pID)
Generates 4 bytes of truly random data.
SOPC_CryptoProvider_AsymmetricGetLength_MsgPlainText
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_MsgPlainText(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pLenMsg)
Provides the maximum length in bytes of a message to be encrypted with a single asymmetric encryption...
SOPC_CryptoProvider_SymmetricGetLength_Signature
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_Signature(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Provides the length in bytes of the symmetric signature message.
SOPC_CryptoProvider_AsymmetricDecrypt
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricDecrypt(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKey, uint8_t *pOutput, uint32_t lenOutput, uint32_t *pLenWritten, const char **errorReason)
Decrypts a payload pInput of lenInput bytes.
SOPC_CryptoProvider_AsymmetricGetLength_KeyBits
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_KeyBits(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pLenKeyBits)
Writes the length in bits in pLenKeyBits of the asymmetric key pKey.
sopc_crypto_decl.h
Defines the common declarations for the cryptographic objects.
SOPC_CryptoProvider_GenerateRandomBytes
SOPC_ReturnStatus SOPC_CryptoProvider_GenerateRandomBytes(const SOPC_CryptoProvider *pProvider, uint32_t nBytes, SOPC_ExposedBuffer **ppBuffer)
Generates truly random data of arbitrary length.
SOPC_CryptoProvider_Deinit
SOPC_ReturnStatus SOPC_CryptoProvider_Deinit(SOPC_CryptoProvider *pCryptoProvider)
Deinitializes a SOPC_CryptoProvider context (this process is specific to the chosen cryptographic lib...
sopc_enums.h
SOPC_CryptolibContext
Definition: crypto_provider_lib.h:35
SOPC_CryptoProvider
The SOPC_CryptoProvider context.
Definition: sopc_crypto_provider.h:47
SOPC_CryptoProvider_AsymmetricGetLength_Encryption
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_Encryption(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t lengthIn, uint32_t *pLengthOut)
Calculates the size of the required output buffer to cipher lengthIn bytes through asymmetric encrypt...
SOPC_CryptoProvider_SymmetricVerify
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricVerify(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, SOPC_SecretBuffer *pKey, const uint8_t *pSignature, uint32_t lenOutput)
Verifies the signature pSignature of the payload pInput of lenInput bytes.
SOPC_CryptoProvider_SymmetricDecrypt
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricDecrypt(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenCipherText, SOPC_SecretBuffer *pKey, SOPC_SecretBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
Decrypts a payload pInput of lenPlainText bytes into a padded deciphered payload pOutput.
SOPC_CryptoProvider_AsymmetricGetLength_KeyBytes
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_KeyBytes(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pLenKeyBytes)
Writes the length in bytes in pLenKeyBytes of the asymmetric key pKey.
SOPC_CryptoProvider_GenerateSecureChannelNonce
SOPC_ReturnStatus SOPC_CryptoProvider_GenerateSecureChannelNonce(const SOPC_CryptoProvider *pProvider, SOPC_SecretBuffer **ppNonce)
Generates a single truly random nonce for the SecureChannel creation.
SOPC_CryptoProvider_AsymmetricGetLength_OAEPHashLength
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_OAEPHashLength(const SOPC_CryptoProvider *pProvider, uint32_t *length)
Provides the length of the hash used for OAEP encryption/decryption.
SOPC_CryptoProvider_AsymmetricGetLength_PSSHashLength
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_PSSHashLength(const SOPC_CryptoProvider *pProvider, uint32_t *length)
Provides the length of the hash used for PSS signature/verification.
SOPC_CryptoProvider_DeriveKeySetsServer
SOPC_ReturnStatus SOPC_CryptoProvider_DeriveKeySetsServer(const SOPC_CryptoProvider *pProvider, const SOPC_ExposedBuffer *pClientNonce, uint32_t lenClientNonce, SOPC_SecretBuffer *pServerNonce, SOPC_SC_SecurityKeySet *pClientKeySet, SOPC_SC_SecurityKeySet *pServerKeySet)
Derive pseudo-random key sets from the randomly generated and shared secrets.
SOPC_CryptoProvider_SymmetricSign
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricSign(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, SOPC_SecretBuffer *pKey, uint8_t *pOutput, uint32_t lenOutput)
Signs a payload pInput of lenInput bytes, writes the signature in pOutput of lenOutput bytes.
SOPC_CryptoProvider_Init
SOPC_ReturnStatus SOPC_CryptoProvider_Init(SOPC_CryptoProvider *pCryptoProvider)
Initializes a SOPC_CryptoProvider context. Called by SOPC_CryptoProvider_Create() upon context creati...
SOPC_CryptoProvider_SymmetricEncrypt
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricEncrypt(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenPlainText, SOPC_SecretBuffer *pKey, SOPC_SecretBuffer *pIV, uint8_t *pOutput, uint32_t lenOutput)
Encrypts a padded payload pInput of lenPlainText bytes.
SOPC_CryptoProvider_SymmetricGetLength_SecureChannelNonce
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_SecureChannelNonce(const SOPC_CryptoProvider *pProvider, uint32_t *pLenNonce)
Provides the length in bytes of the SecureChannel nonces used in the symmetric encryption process.
SOPC_CryptoProvider_PubSubCrypt
SOPC_ReturnStatus SOPC_CryptoProvider_PubSubCrypt(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, SOPC_SecretBuffer *pKey, SOPC_SecretBuffer *pKeyNonce, const SOPC_ExposedBuffer *pRandom, uint32_t lenRandom, uint32_t uSequenceNumber, uint8_t *pOutput, uint32_t lenOutput)
Encrypts or Decrypts a payload pInput of lenInput bytes.
SOPC_CryptoProvider_SymmetricGetLength_CryptoKey
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_CryptoKey(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Writes the length in bytes in pLength of the key used for symmetric encryption/decryption.
SOPC_CryptoProvider_Free
void SOPC_CryptoProvider_Free(SOPC_CryptoProvider *pCryptoProvider)
Frees a SOPC_CryptoProvider created with SOPC_CryptoProvider_Create().
SOPC_CryptoProvider_CreatePubSub
SOPC_CryptoProvider * SOPC_CryptoProvider_CreatePubSub(const char *uri)
Creates an initialized SOPC_CryptoProvider context for PubSub exchanges from a string containing the ...
SOPC_CryptoProvider_SymmetricGetLength_Decryption
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_Decryption(const SOPC_CryptoProvider *pProvider, uint32_t lengthIn, uint32_t *pLengthOut)
Writes the length in bytes in pLengthOut of a decrypted message of lengthIn bytes.
SOPC_CryptoProvider_AsymmetricVerify
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricVerify(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKeyRemotePublic, const uint8_t *pSignature, uint32_t lenSignature, const char **errorReason)
Verifies the signature pSignature of a payload pInput of lenInput bytes.
SOPC_CryptoProvider_DeriveKeySetsClient
SOPC_ReturnStatus SOPC_CryptoProvider_DeriveKeySetsClient(const SOPC_CryptoProvider *pProvider, SOPC_SecretBuffer *pClientNonce, const SOPC_ExposedBuffer *pServerNonce, uint32_t lenServerNonce, SOPC_SC_SecurityKeySet *pClientKeySet, SOPC_SC_SecurityKeySet *pServerKeySet)
Derive pseudo-random key sets from the randomly generated and shared secrets.
SOPC_CryptoProvider_PubSubGetLength_KeyNonce
SOPC_ReturnStatus SOPC_CryptoProvider_PubSubGetLength_KeyNonce(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Writes the length in bytes in pLength of the key nonce used for PubSub encryption/decryption.
SOPC_CryptoProvider_AsymmetricGetLength_Decryption
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_Decryption(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t lengthIn, uint32_t *pLengthOut)
Calculates the size of the required output buffer to decipher lengthIn bytes through asymmetric decry...
sopc_key_sets.h
SOPC_AsymmetricKey
The asymmetric key representation.
Definition: key_manager_lib.h:46
SOPC_CryptoProvider::pProfile
const SOPC_CryptoProfile *const pProfile
Definition: sopc_crypto_provider.h:54
SOPC_CryptoProvider_Certificate_Validate
SOPC_ReturnStatus SOPC_CryptoProvider_Certificate_Validate(const SOPC_CryptoProvider *pProvider, const SOPC_PKIProvider *pPKI, const SOPC_CertificateList *pCert, uint32_t *error)
Validates the given Certificate pCert.
SOPC_CryptoProfile
SOPC_CryptoProfiles gather pointers to cryptographic functions of the security policies of OPC UA Ser...
Definition: sopc_crypto_profiles.h:218
SOPC_SC_SecurityKeySet
Definition: sopc_key_sets.h:26
SOPC_CryptoProfile_PubSub
SOPC_CryptoProfiles_PubSub gather pointers to cryptographic functions of the security policies of OPC...
Definition: sopc_crypto_profiles.h:243
SOPC_SecretBuffer
struct SOPC_SecretBuffer SOPC_SecretBuffer
Definition: sopc_secret_buffer.h:35
SOPC_CryptoProvider_AsymmetricGetLength_Signature
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_Signature(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pLength)
Calculates the size of the required output buffer to contain the asymmetric signature.
SOPC_ExposedBuffer
uint8_t SOPC_ExposedBuffer
Definition: sopc_secret_buffer.h:36
SOPC_CryptoProvider_AsymmetricGetLength_Msgs
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricGetLength_Msgs(const SOPC_CryptoProvider *pProvider, const SOPC_AsymmetricKey *pKey, uint32_t *pCipherTextBlockSize, uint32_t *pPlainTextBlockSize)
Provides the lengths in bytes of the messages used in asymmetric encryption process.
SOPC_CryptoProvider_SymmetricGetLength_Blocks
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_Blocks(const SOPC_CryptoProvider *pProvider, uint32_t *pCipherTextBlockSize, uint32_t *pPlainTextBlockSize)
Provides the lengths in bytes of the blocks used in the symmetric encryption process.
SOPC_CryptoProvider_AsymmetricSign
SOPC_ReturnStatus SOPC_CryptoProvider_AsymmetricSign(const SOPC_CryptoProvider *pProvider, const uint8_t *pInput, uint32_t lenInput, const SOPC_AsymmetricKey *pKeyPrivateLocal, uint8_t *pSignature, uint32_t lenSignature, const char **errorReason)
Signs a payload pInput of lenInput bytes.
sopc_secret_buffer.h
SecretBuffer (mangled key) and ExposedBuffer (contiguous deciphered buffered) APIs.
SOPC_CryptoProvider_AsymmetricGetUri_SignAlgorithm
const char * SOPC_CryptoProvider_AsymmetricGetUri_SignAlgorithm(const SOPC_CryptoProvider *pProvider)
Returns the URI of the AsymetricSignatureAlgorithm.
SOPC_CryptoProvider_SymmetricGetLength_SignKey
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_SignKey(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Writes the length in bytes in pLength of the key used for symmetric signature.
SOPC_CryptoProvider_SymmetricGetLength_Encryption
SOPC_ReturnStatus SOPC_CryptoProvider_SymmetricGetLength_Encryption(const SOPC_CryptoProvider *pProvider, uint32_t lengthIn, uint32_t *pLengthOut)
Writes the length in bytes in pLengthOut of an encrypted message of lengthIn bytes.
SOPC_CryptoProvider_CertificateGetLength_Thumbprint
SOPC_ReturnStatus SOPC_CryptoProvider_CertificateGetLength_Thumbprint(const SOPC_CryptoProvider *pProvider, uint32_t *pLength)
Calculates the size of the signature of the certificates.
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:61