CJOSE  0.6.0
jws.h
Go to the documentation of this file.
1 /*
2  * Copyrights
3  *
4  * Portions created or assigned to Cisco Systems, Inc. are
5  * Copyright (c) 2014-2016 Cisco Systems, Inc. All Rights Reserved.
6  */
7 
15 #ifndef CJOSE_JWS_H
16 #define CJOSE_JWS_H
17 
18 #include <stdbool.h>
19 #include <stdint.h>
20 #include <stddef.h>
21 #include "header.h"
22 #include "jwk.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 typedef struct _cjose_jws_int cjose_jws_t;
32 
46  const cjose_jwk_t *jwk, cjose_header_t *protected_header, const uint8_t *plaintext, size_t plaintext_len, cjose_err *err);
47 
63 bool cjose_jws_export(cjose_jws_t *jws, const char **ser, cjose_err *err);
64 
77 cjose_jws_t *cjose_jws_import(const char *compact, size_t compact_len, cjose_err *err);
78 
88 bool cjose_jws_verify(cjose_jws_t *jws, const cjose_jwk_t *jwk, cjose_err *err);
89 
104 bool cjose_jws_get_plaintext(const cjose_jws_t *jws, uint8_t **plaintext, size_t *plaintext_len, cjose_err *err);
105 
117 
123 void cjose_jws_release(cjose_jws_t *jws);
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif // CJOSE_JWS_H
void cjose_jws_release(cjose_jws_t *jws)
Functions and data structures for interacting with JSON Web Signature (JWS) objects.
Functions and data structures for interacting with JSON Web Key (JWK) objects.
struct _cjose_jwk_int cjose_jwk_t
Definition: jwk.h:49
bool cjose_jws_verify(cjose_jws_t *jws, const cjose_jwk_t *jwk, cjose_err *err)
bool cjose_jws_export(cjose_jws_t *jws, const char **ser, cjose_err *err)
struct json_t cjose_header_t
Definition: header.h:96
Definition: error.h:65
struct _cjose_jws_int cjose_jws_t
Definition: jws.h:31
cjose_header_t * cjose_jws_get_protected(cjose_jws_t *jws)
bool cjose_jws_get_plaintext(const cjose_jws_t *jws, uint8_t **plaintext, size_t *plaintext_len, cjose_err *err)
cjose_jws_t * cjose_jws_sign(const cjose_jwk_t *jwk, cjose_header_t *protected_header, const uint8_t *plaintext, size_t plaintext_len, cjose_err *err)
cjose_jws_t * cjose_jws_import(const char *compact, size_t compact_len, cjose_err *err)