Go to the source code of this file.
|
#define | KSI_Signature_fromFile(ctx, fileName, sig) KSI_Signature_fromFileWithPolicy(ctx, fileName, KSI_VERIFICATION_POLICY_INTERNAL, NULL, sig) |
|
#define | KSI_Signature_sign(ctx, hsh, signature) KSI_Signature_signWithPolicy(ctx, hsh, KSI_VERIFICATION_POLICY_INTERNAL, NULL, signature) |
|
|
int | KSI_Signature_getHashAlgorithm (const KSI_Signature *sig, KSI_HashAlgorithm *algo_id) |
|
int | KSI_Signature_createDataHasher (const KSI_Signature *sig, KSI_DataHasher **hsr) |
|
int | KSI_Signature_verifyWithPolicy (KSI_Signature *sig, const KSI_DataHash *docHsh, KSI_uint64_t rootLevel, const KSI_Policy *policy, KSI_VerificationContext *verificationContext) |
|
int | KSI_Signature_verifyDocument (KSI_Signature *sig, KSI_CTX *ctx, const void *doc, size_t doc_len) |
|
int | KSI_Signature_fromFileWithPolicy (KSI_CTX *ctx, const char *fileName, const KSI_Policy *policy, KSI_VerificationContext *context, KSI_Signature **sig) |
|
int | KSI_Signature_signWithPolicy (KSI_CTX *ctx, KSI_DataHash *hsh, const KSI_Policy *policy, KSI_VerificationContext *context, KSI_Signature **signature) |
|
int | KSI_Signature_create (KSI_CTX *ctx, KSI_DataHash *hsh, KSI_Signature **signature) |
|
int | KSI_Signature_createAggregated (KSI_CTX *ctx, KSI_DataHash *rootHash, uint64_t rootLevel, KSI_Signature **signature) |
|
A convenience function for reading a signature from a file. The signature is verified with the provided policy and context.
- Parameters
-
[in] | ctx | KSI context. |
[in] | fileName | Name of the signature file. |
[in] | policy | Verification policy. |
[in] | context | Verification context. |
[out] | sig | Pointer to the receiving pointer. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- It must be noted that access to metadata, supported by some file systems, is limited by the use of function
fopen
. Alternate Data Streams (WIndows NTFS) and Resource Forks (OS X HFS) may or may not be supported, depending on the C standard library used in the application.
This function signs the given data hash hsh
. This function requires a access to a working aggregator and fails if it is not accessible. The signature is verified with the provided policy and context.
- Parameters
-
[in] | ctx | KSI context. |
[in] | hsh | Document hash. |
[in] | policy | Verification policy. |
[in] | context | Verification context. |
[out] | signature | Pointer to the receiving pointer. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- For signing hash values, the use of KSI_createSignature is strongly recomended.
- See also
- KSI_createSignature, KSI_Signature_free
int KSI_Signature_verifyDocument |
( |
KSI_Signature * |
sig, |
|
|
KSI_CTX * |
ctx, |
|
|
const void * |
doc, |
|
|
size_t |
doc_len |
|
) |
| |
Verifies that the document matches the signature.
- Parameters
-
[in] | sig | KSI signature. |
[in] | ctx | KSI context. |
[in] | doc | Pointer to document. |
[in] | doc_len | Document length. |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
Verifies the signature based on the given verification policy.
- Parameters
-
[in] | sig | KSI signature. |
[in] | docHsh | Document hash. Can be ommited. |
[in] | rootLevel | The level of the input hash (usually 0). |
[in] | policy | Verification policy. Can be ommited. |
| verificationContext | |
- Returns
- status code (KSI_OK, when operation succeeded, otherwise an error code).
- Note
- In case the
docHsh
is ommited, only the signature is verified.