Apache2
|
#include <apr_jose.h>
Data Fields | |
apr_status_t(* | encrypt )(apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, void *ctx, apr_pool_t *pool) |
apr_status_t(* | decrypt )(apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, apr_json_value_t *header, apr_jose_text_t *ph64, apr_jose_text_t *aad64, void *ctx, int *dflags, apr_pool_t *pool) |
apr_status_t(* | sign )(apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_signature_t *signature, void *ctx, apr_pool_t *pool) |
apr_status_t(* | verify )(apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_signature_t *signature, void *ctx, int *vflags, apr_pool_t *pool) |
void * | ctx |
Callbacks for encryption, decryption, signing and verifying.
void* apr_jose_cb_t::ctx |
Context to be passed to the callback.
apr_status_t(* apr_jose_cb_t::decrypt) (apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, apr_json_value_t *header, apr_jose_text_t *ph64, apr_jose_text_t *aad64, void *ctx, int *dflags, apr_pool_t *pool) |
Callback that decrypts the ciphertext based on the parameters provided by the recipient and encryption parameters, and writes the resulting decrypted value to the bucket brigade. Base64url versions of the protected header and the aad are provided as part of the JWE decryption mechanism.
For security reasons, this callback MUST verify that the algorithm present in the JWE matches the algorithm expected by the decoder.
The decrypt function is expected to perform some or all of the following steps:
bb | Brigade where decrypted data is to be written. |
jose | The JOSE structure. |
recipient | Structure containing details of the recipient of this message, to be used to decrypt the message. |
encryption | Structure containing the encrypted message. |
header | The JOSE protected header. |
p64 | The JOSE protected header in original BASE64URL format, for use during decryption. |
aad64 | The JOSE additional authenticated data in original BASE64URL format, for use during decryption. |
ctx | A context. |
dflags | A pointer to a flag. Set to APR_JOSE_FLAG_NONE for decryption to continue to the next recipient in the JWE, or APR_JOSE_FLAG_BREAK to stop decrypting further recipients. |
pool | The pool to use. |
apr_status_t(* apr_jose_cb_t::encrypt) (apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_recipient_t *recipient, apr_jose_encryption_t *encryption, void *ctx, apr_pool_t *pool) |
Callback that encrypts the content of the bucket brigade bb based on the parameters provided by the jwe->protected_header, and writes the resulting encrypted key to recipient->ekey, the initialisation vector to encryption->iv, the additional authentication data to encryption->aad, the cipher text to encryption->cipher, and the tag to encryption->tag.
The encrypt function is expected to perform some or all of the following steps:
bb | Brigade containing data to be encrypted. |
jose | The JOSE structure. |
recipient | Structure containing details of the recipient of this message. |
encryption | Structure to be filled out by the callback containing the encrypted message. |
ctx | A context. |
pool | The pool to use. |
apr_status_t(* apr_jose_cb_t::sign) (apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_signature_t *signature, void *ctx, apr_pool_t *pool) |
Callback that signs the content of the bucket brigade bb based on the parameters provided by the signature protected header, and writes the resulting binary signature to signature->sig.
The sign function is expected to perform some or all of the following steps:
bb | Brigade containing data to be signed. |
jose | The JOSE structure. |
signature | Structure to be filled out by the callback containing the signature of the message. |
ctx | A context. |
pool | The pool to use. |
apr_status_t(* apr_jose_cb_t::verify) (apr_bucket_brigade *bb, apr_jose_t *jose, apr_jose_signature_t *signature, void *ctx, int *vflags, apr_pool_t *pool) |
Callback that verifies the content of the bucket brigade bb based on the parameters provided by the signature protected header and signature->sig.
For security reasons, this callback MUST verify that the algorithm present in the JWS matches the algorithm expected by the decoder.
The verify function is expected to perform some or all of the following steps:
bb | Brigade containing data to be verified. |
jose | The JOSE structure. |
signature | Structure containing the signature to be verified. |
ctx | A context. |
dflags | A pointer to a flag. Set to APR_JOSE_FLAG_NONE for verification to continue to the next recipient in the JWE, or APR_JOSE_FLAG_BREAK to stop verifying further recipients. |
pool | The pool to use. |