José

jws.h
1 /* vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80: */
2 /*
3 * Copyright 2016 Red Hat, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
55 #pragma once
56
57 #include "cfg.h"
58 #include "io.h"
59 #include <jansson.h>
60 #include <stdbool.h>
61 #include <stdint.h>
62
69 json_t *
70 jose_jws_hdr(const json_t *sig);
71
109 bool
110 jose_jws_sig(jose_cfg_t *cfg, json_t *jws, json_t *sig, const json_t *jwk);
111
133 jose_io_t *
134 jose_jws_sig_io(jose_cfg_t *cfg, json_t *jws, json_t *sig, const json_t *jwk);
135
136
170 bool
171 jose_jws_ver(jose_cfg_t *cfg, const json_t *jws, const json_t *sig,
172 const json_t *jwk, bool all);
173
193 jose_io_t *
194 jose_jws_ver_io(jose_cfg_t *cfg, const json_t *jws, const json_t *sig,
195 const json_t *jwk, bool all);
196
jose_jws_sig_io
jose_io_t * jose_jws_sig_io(jose_cfg_t *cfg, json_t *jws, json_t *sig, const json_t *jwk)
Creates one or more signatures in a JWS object using streaming.
jose_io_t
The interface for chained IO.
Definition: io.h:61
jose_jws_ver_io
jose_io_t * jose_jws_ver_io(jose_cfg_t *cfg, const json_t *jws, const json_t *sig, const json_t *jwk, bool all)
Verifies signatures of one or more JWKs in a JWS object using streaming.
jose_jws_ver
bool jose_jws_ver(jose_cfg_t *cfg, const json_t *jws, const json_t *sig, const json_t *jwk, bool all)
Verifies signatures of one or more JWKs in a JWS object.
jose_jws_sig
bool jose_jws_sig(jose_cfg_t *cfg, json_t *jws, json_t *sig, const json_t *jwk)
Creates one or more signatures in a JWS object.
jose_jws_hdr
json_t * jose_jws_hdr(const json_t *sig)
Merges the JOSE headers of a JWS signature object.