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

native.jniutil.exceptions.c 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.6 for Java 8 and later.

The newest version!
//
//

#include "exceptions.h"
#include 

void throw_java_NPE(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "java/lang/NullPointerException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}

void throw_java_illegal_argument(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "java/lang/IllegalArgumentException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}

void throw_java_invalid_state(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "java/lang/IllegalStateException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}

void throw_bc_data_length_exception(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "org/bouncycastle/crypto/DataLengthException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}

void throw_bc_output_length_exception(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "org/bouncycastle/crypto/OutputLengthException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}

void throw_bc_invalid_ciphertext_exception(JNIEnv *env, const char *msg) {
    jclass exClass = (*env)->FindClass(env, "org/bouncycastle/crypto/InvalidCipherTextException");
    assert(exClass != NULL);
    (*env)->ThrowNew(env, exClass, msg);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy