CJOSE  0.4.1
jwe.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_JWE_H
16 #define CJOSE_JWE_H
17 
18 #include <stdbool.h>
19 #include <stdint.h>
20 #include <stddef.h>
21 #include "header.h"
22 #include "error.h"
23 #include "jwk.h"
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 
34 typedef struct _cjose_jwe_int cjose_jwe_t;
35 
36 
56  const cjose_jwk_t *jwk,
57  cjose_header_t *protected_header,
58  const uint8_t *plaintext,
59  size_t plaintext_len,
60  cjose_err *err);
61 
62 
77 char *cjose_jwe_export(
78  cjose_jwe_t *jwe,
79  cjose_err *err);
80 
94  const char *compact,
95  size_t compact_len,
96  cjose_err *err);
97 
111 uint8_t *cjose_jwe_decrypt(
112  cjose_jwe_t *jwe,
113  const cjose_jwk_t *jwk,
114  size_t *content_len,
115  cjose_err *err);
116 
117 
129 
135 void cjose_jwe_release(cjose_jwe_t *jwe);
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif // CJOSE_JWE_H
uint8_t * cjose_jwe_decrypt(cjose_jwe_t *jwe, const cjose_jwk_t *jwk, size_t *content_len, cjose_err *err)
Functions and data structures for interacting with JSON Web Signature (JWS) objects.
Functions and data structures for interacting with JSON Web Key (JWK) objects.
cjose_header_t * cjose_jwe_get_protected(cjose_jwe_t *jwe)
cjose_jwe_t * cjose_jwe_import(const char *compact, size_t compact_len, cjose_err *err)
struct _cjose_jwk_int cjose_jwk_t
Definition: jwk.h:51
Datatypes and functions for error reporting.
struct _cjose_jwe_int cjose_jwe_t
Definition: jwe.h:34
struct json_t cjose_header_t
Definition: header.h:89
Definition: error.h:70
void cjose_jwe_release(cjose_jwe_t *jwe)
cjose_jwe_t * cjose_jwe_encrypt(const cjose_jwk_t *jwk, cjose_header_t *protected_header, const uint8_t *plaintext, size_t plaintext_len, cjose_err *err)
char * cjose_jwe_export(cjose_jwe_t *jwe, cjose_err *err)