CJOSE  0.4.1
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 {
27 #endif
28 
29 
33 typedef struct _cjose_jws_int cjose_jws_t;
34 
35 
49  const cjose_jwk_t *jwk,
50  cjose_header_t *protected_header,
51  const uint8_t *plaintext,
52  size_t plaintext_len,
53  cjose_err *err);
54 
55 
71 bool cjose_jws_export(
72  cjose_jws_t *jws,
73  const char **ser,
74  cjose_err *err);
75 
76 
90  const char *compact,
91  size_t compact_len,
92  cjose_err *err);
93 
94 
104 bool cjose_jws_verify(
105  cjose_jws_t *jws,
106  const cjose_jwk_t *jwk,
107  cjose_err *err);
108 
109 
125  const cjose_jws_t *jws,
126  uint8_t **plaintext,
127  size_t *plaintext_len,
128  cjose_err *err);
129 
130 
142 
148 void cjose_jws_release(cjose_jws_t *jws);
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #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:51
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:89
Definition: error.h:70
struct _cjose_jws_int cjose_jws_t
Definition: jws.h:33
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)