All Downloads are FREE. Search and download functionalities are using the official Maven repository.

native.jniutil.bytearrays.h Maven / Gradle / Ivy

Go to download

The Long Term Stable (LTS) Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains the JCA/JCE provider and low-level API for the BC LTS version 2.73.1 for Java 8 and later.

There is a newer version: 2.73.6
Show newest version
//

#ifndef BC_FIPS_BYTEARRAYS_H
#define BC_FIPS_BYTEARRAYS_H

#include 
#include 
#include 
#include "jni.h"
#include 

typedef struct {
    uint8_t *bytearray;
    size_t size;
    JNIEnv *env;
    jbyteArray array;
} java_bytearray_ctx;


/**
 * Init a byte array context setting values to null.
 * It is safe to call release_bytearray_ctx after applying this function.
 * @param ctx
 */
void init_bytearray_ctx(java_bytearray_ctx *ctx);

/**
 * Load a java byte array and claim it from the jvm
 * @param env
 * @param array
 * @return
 */
int load_bytearray_ctx(java_bytearray_ctx *ctx, JNIEnv *env, jbyteArray array);


/**
 * release_bytearray_ctx releases a java byte ctx back to the jvm
 * null safe and unclaimed safe.
 * @param ctx
 */
void release_bytearray_ctx(java_bytearray_ctx *ctx);

#endif //BC_FIPS_BYTEARRAYS_H




© 2015 - 2024 Weber Informatics LLC | Privacy Policy