Using AKM, ignoring "incidental" issues such as error and logging, and dropping some variables:
ato_Cxt *ctx;
ato_CfgMgr *cfgmgr;
ato_si_set(
"Your Organisation Name Here",
"ATO AKM Reference Client (C version)",
"0.6", buildtime, hash);
ato_cfgm_create(ctx, &cfgmgr, NULL, "test")
logsomethingbutcarryon("Warning: renewal for '%s' failed\n", alias);
free(buffer);
ato_cfgm_free(cfgmgr);
ATO_AKM_EXPORT bool ato_cr_isrenewable(ato_Ctx *ctx, ato_Credential *cr)
Determines if the credential is ready to be renewed - see ato_cr_renew().
ATO_AKM_EXPORT int ato_cr_privatekey(ato_Ctx *ctx, ato_Credential *cr, ato_String **privatekey, const char *pwd)
Construct a decrypted private key object from the credential and return as a DER encoded array.
ATO_AKM_EXPORT int ato_cr_certificate(ato_Ctx *ctx, ato_Credential *cr, ato_String **certificate)
Construct a X509 certificate object from the credential and return as a DER encoded array.
ATO_AKM_EXPORT ato_Credential * ato_ks_credential(ato_Keystore *ks, const char *alias)
Return the credential corresponding to alias or NULL if not found.
ATO_AKM_EXPORT int ato_ks_create(ato_Ctx *ctx, ato_Keystore **ks, const char *buffer, const ato_ksProperties *properties)
Create a keystore object from the XML stored in buffer.
ATO_AKM_EXPORT void * ato_ks_free(ato_Keystore *ks)
Free the keystore object if not NULL.
ATO_AKM_EXPORT void ato_akm_deinit(void)
Deinitialise the SDK.
ATO_AKM_EXPORT int ato_akm_init(ato_Ctx *ctx, unsigned short flag)
Initialise the SDK.
#define ATO_AKM_INIT_ALL
The ATO_AKM_INIT_... defines are used to control the initialisation that takes place.
Definition: types.h:37
ATO_EXPORT void ato_ctx_free(ato_Ctx *ctx)
ATO_EXPORT void ato_ctx_create(ato_Ctx **ctx, const char *id)
ATO_EXPORT void ato_base_deinit(void)
ATO_EXPORT int ato_base_init(ato_Ctx *ctx, unsigned short flag)
ATO_EXPORT int ato_si_set(const char *organisation, const char *product, const char *version, const char *timestamp, const char *source, const char *hash)
#define ATO_BASE_INIT_ALL