Guardtime KSI c SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pkitruststore.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013-2015 Guardtime, Inc.
3  *
4  * This file is part of the Guardtime client SDK.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License").
7  * You may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  * http://www.apache.org/licenses/LICENSE-2.0
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
13  * express or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  * "Guardtime" and "KSI" are trademarks or registered trademarks of
16  * Guardtime, Inc., and no license to trademarks is granted; Guardtime
17  * reserves and retains all trademark rights.
18  */
19 
20 #ifndef KSI_TRUSTSTORE_H_
21 #define KSI_TRUSTSTORE_H_
22 
23 #include "types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
51 
62  int KSI_PKITruststore_new(KSI_CTX *ctx, int setDefaults, KSI_PKITruststore **store);
63 
69 
80  int KSI_PKICertificate_new(KSI_CTX *ctx, const void *der, size_t der_len, KSI_PKICertificate **cert);
81 
87 
90 
97  int KSI_PKICertificate_serialize(const KSI_PKICertificate *cert, unsigned char **raw, size_t *raw_len);
98 
108  int KSI_PKISignature_new(KSI_CTX *ctx, const void *raw, size_t raw_len, KSI_PKISignature **signature);
109 
115 
123 
124 
133  int KSI_PKISignature_serialize(const KSI_PKISignature *sig, unsigned char **raw, size_t *raw_len);
134 
137 
151  int KSI_PKITruststore_verifyRawSignature(KSI_CTX *ctx, const unsigned char *data, size_t data_len, const char *algoOid, const unsigned char *signature, size_t signature_len, const KSI_PKICertificate *cert);
152 
153  KSI_FN_DEPRECATED(int KSI_PKITruststore_verifySignature(KSI_PKITruststore *pki, const unsigned char *data, size_t data_len, const KSI_PKISignature *signature), Use #KSI_PKITruststore_verifyPKISignature instead.);
154 
168  int KSI_PKITruststore_verifyPKISignature(const KSI_PKITruststore *pki, const unsigned char *data, size_t data_len, const KSI_PKISignature *signature, KSI_CertConstraint *certConstraints);
169 
178  int KSI_PKITruststore_addLookupFile(const KSI_PKITruststore *store, const char *path);
179 
188  int KSI_PKITruststore_addLookupDir(const KSI_PKITruststore *store, const char *path);
189 
198  char* KSI_PKICertificate_toString(const KSI_PKICertificate *cert, char *buf, size_t buf_len);
199 
207 
215 
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #endif /* KSI_TRUSTSTORE_H_ */
int KSI_PKITruststore_new(KSI_CTX *ctx, int setDefaults, KSI_PKITruststore **store)
#define KSI_uint64_t
Definition: types_base.h:105
struct KSI_PKISignature_st KSI_PKISignature
Definition: types.h:98
#define KSI_DEFINE_FN_TO_TLV(typ)
Definition: types_base.h:41
int KSI_PKISignature_new(KSI_CTX *ctx, const void *raw, size_t raw_len, KSI_PKISignature **signature)
int KSI_PKISignature_extractCertificate(const KSI_PKISignature *signature, KSI_PKICertificate **cert)
#define KSI_DEFINE_FN_FROM_TLV(typ)
Definition: types_base.h:30
int KSI_PKITruststore_verifyRawSignature(KSI_CTX *ctx, const unsigned char *data, size_t data_len, const char *algoOid, const unsigned char *signature, size_t signature_len, const KSI_PKICertificate *cert)
int KSI_PKICertificate_getValidityNotBefore(const KSI_PKICertificate *cert, KSI_uint64_t *time)
int KSI_PKISignature_serialize(const KSI_PKISignature *sig, unsigned char **raw, size_t *raw_len)
#define KSI_FN_DEPRECATED(decl, comment)
Definition: common.h:50
char * KSI_PKICertificate_toString(const KSI_PKICertificate *cert, char *buf, size_t buf_len)
int KSI_PKITruststore_verifySignature(KSI_PKITruststore *pki, const unsigned char *data, size_t data_len, const KSI_PKISignature *signature)
Definition: types.h:150
int KSI_PKICertificate_serialize(const KSI_PKICertificate *cert, unsigned char **raw, size_t *raw_len)
int KSI_PKITruststore_addLookupFile(const KSI_PKITruststore *store, const char *path)
void KSI_PKICertificate_free(KSI_PKICertificate *cert)
struct KSI_CTX_st KSI_CTX
Definition: types_base.h:124
int KSI_PKITruststore_addLookupDir(const KSI_PKITruststore *store, const char *path)
struct KSI_PKICertificate_st KSI_PKICertificate
Definition: types.h:93
void KSI_PKISignature_free(KSI_PKISignature *sig)
int KSI_PKITruststore_registerGlobals(KSI_CTX *ctx)
struct KSI_PKITruststore_st KSI_PKITruststore
Definition: types.h:103
int KSI_PKICertificate_new(KSI_CTX *ctx, const void *der, size_t der_len, KSI_PKICertificate **cert)
void KSI_PKITruststore_free(KSI_PKITruststore *store)
int KSI_PKITruststore_verifyPKISignature(const KSI_PKITruststore *pki, const unsigned char *data, size_t data_len, const KSI_PKISignature *signature, KSI_CertConstraint *certConstraints)
int KSI_PKICertificate_getValidityNotAfter(const KSI_PKICertificate *cert, KSI_uint64_t *time)