CJOSE  0.4.1
header.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 
16 #ifndef CJOSE_HEADER_H
17 #define CJOSE_HEADER_H
18 
19 #include <stdbool.h>
20 #include "cjose/error.h"
21 
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26 
27 
29 extern const char *CJOSE_HDR_ALG;
30 
32 extern const char *CJOSE_HDR_ENC;
33 
35 extern const char *CJOSE_HDR_CTY;
36 
38 extern const char *CJOSE_HDR_KID;
39 
41 extern const char *CJOSE_HDR_ALG_NONE;
42 
44 extern const char *CJOSE_HDR_ALG_RSA_OAEP;
45 
47 extern const char *CJOSE_HDR_ALG_RSA1_5;
48 
50 extern const char *CJOSE_HDR_ALG_A128KW;
51 extern const char *CJOSE_HDR_ALG_A192KW;
52 extern const char *CJOSE_HDR_ALG_A256KW;
53 
55 extern const char *CJOSE_HDR_ALG_PS256;
56 extern const char *CJOSE_HDR_ALG_PS384;
57 extern const char *CJOSE_HDR_ALG_PS512;
58 
60 extern const char *CJOSE_HDR_ALG_RS256;
61 extern const char *CJOSE_HDR_ALG_RS384;
62 extern const char *CJOSE_HDR_ALG_RS512;
63 
65 extern const char *CJOSE_HDR_ALG_HS256;
66 extern const char *CJOSE_HDR_ALG_HS384;
67 extern const char *CJOSE_HDR_ALG_HS512;
68 
70 extern const char *CJOSE_HDR_ALG_ES256;
71 extern const char *CJOSE_HDR_ALG_ES384;
72 extern const char *CJOSE_HDR_ALG_ES512;
73 
75 extern const char *CJOSE_HDR_ALG_DIR;
76 
78 extern const char *CJOSE_HDR_ENC_A256GCM;
79 
81 extern const char *CJOSE_HDR_ENC_A128CBC_HS256;
82 extern const char *CJOSE_HDR_ENC_A192CBC_HS384;
83 extern const char *CJOSE_HDR_ENC_A256CBC_HS512;
84 
85 
89 typedef struct json_t cjose_header_t;
90 
91 
101  cjose_err *err);
102 
103 
113  cjose_header_t *header);
114 
123  cjose_header_t *header);
124 
125 
137 bool cjose_header_set(
138  cjose_header_t *header,
139  const char *attr,
140  const char *value,
141  cjose_err *err);
142 
153 const char *cjose_header_get(
154  cjose_header_t *header,
155  const char *attr,
156  cjose_err *err);
157 
158 
159 #ifdef __cplusplus
160 }
161 #endif
162 
163 #endif // CJOSE_HEADER_H
const char * CJOSE_HDR_ENC
cjose_header_t * cjose_header_new(cjose_err *err)
const char * CJOSE_HDR_ALG_RS256
const char * CJOSE_HDR_ALG
const char * CJOSE_HDR_ENC_A128CBC_HS256
const char * CJOSE_HDR_ALG_RSA1_5
const char * CJOSE_HDR_ALG_A128KW
Datatypes and functions for error reporting.
const char * CJOSE_HDR_ALG_PS256
const char * CJOSE_HDR_KID
const char * CJOSE_HDR_CTY
cjose_header_t * cjose_header_retain(cjose_header_t *header)
const char * CJOSE_HDR_ALG_ES256
struct json_t cjose_header_t
Definition: header.h:89
const char * CJOSE_HDR_ALG_RSA_OAEP
const char * CJOSE_HDR_ENC_A256GCM
Definition: error.h:70
const char * cjose_header_get(cjose_header_t *header, const char *attr, cjose_err *err)
const char * CJOSE_HDR_ALG_NONE
const char * CJOSE_HDR_ALG_HS256
const char * CJOSE_HDR_ALG_DIR
bool cjose_header_set(cjose_header_t *header, const char *attr, const char *value, cjose_err *err)
void cjose_header_release(cjose_header_t *header)