native.jniutil.exceptions.c Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcprov-lts8on Show documentation
Show all versions of bcprov-lts8on Show documentation
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.7 for Java 8 and later.
//
//
#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