atostm  3.2.0
ATOMAS atostm

Using the STM API involves

Create an STM object

ato_Ctx *ctx = NULL;
ato_CfgMgr *ctxmgr = NULL;
ato_Stm *stm = NULL;
const ato_StmTkn *st = NULL;
int errcode = ATO_ERR_OK;
: // initialise the SDKs.
errcode = ato_stm_create(ctx, stm, stsurl, xtemplate);
if (errcode != ATO_ERR_OK) ; // handle the error
:
#define ATO_ERR_OK
struct _ato_Ctx ato_Ctx
struct _ato_Stm ato_Stm
The STM object used to interact with an STS service to retrieve Security Tokens (ato_StmTkn).
Definition: include/atostm/stm.h:12
ATO_STM_EXPORT int ato_stm_create(ato_Ctx *ctx, ato_Stm **stm, const char *stsurl, const char *stmtemplate)
Create an STM object from the XML stored in stmtemplate.
struct _ato_StmTkn ato_StmTkn
The Security Token object.
Definition: stmtkn.h:12

The parameters are:

Note
The stm object must be freed when finished with.

Get a SecurityToken

:
errcode = ato_stm_stsissue(ctx, stm, &st, certificate, privatekey, NULL);
if (errcode != ATO_ERR_OK) ; // handle the error
:
ATO_STM_EXPORT int ato_stm_stsissue(ato_Ctx *ctx, ato_Stm *stm, ato_StmTkn **st, ato_String *certificate, ato_String *privatekey, const char *relyingpartyurl)
Submit an STS issue request to the STS service and return a SecurityToken response object.

The parameters are:

Note
The SecurityToken object is a const which is freed when the STM object is freed.

Retrieve values from the SecurityToken

struct _ato_String ato_String
ATO_STM_EXPORT ato_String * ato_stmtkn_assertion(ato_StmTkn *st)
Given a SecurityToken object, retrieve the encrypted assertion.
ATO_STM_EXPORT ato_String * ato_stmtkn_prooftoken(ato_StmTkn *st)
Given a SecurityToken object, retrieve the embedded proof token.

Cleanup

ATO_STM_EXPORT void ato_stm_free(ato_Ctx *ctx, ato_Stm *stm)
Free the STM object.