37 jobject jccfg, jobject jenc_pub_keys,
38 jstring jsign_sec_key_fname, jobject jpassphrase,
40 jstring jtarget_path, jstring jsubject,
41 jstring jplaintext_version,
42 jstring jplaintext_version_parent,
44 jstring jplaintext_hash_algo,
45 jstring jdestination_fname)
48 jau::jni::shared_ptr_ref<jau::io::ByteStream> refSource(env, jsource_feed);
49 jau::jni::shared_ptr_ref<cipherpack::CipherpackListener> refListener(env, cpListener);
52 std::vector<std::string> enc_pub_keys = jau::jni::convert_jlist_string_to_vector(env, jenc_pub_keys);
53 std::string sign_sec_key_fname = jau::jni::from_jstring_to_string(env, jsign_sec_key_fname);
54 jau::io::secure_string passphrase =
nullptr != jpassphrase ? jau::jni::from_jbytebuffer_to_sstring(env, jpassphrase) : jau::io::secure_string();
55 std::string target_path = jau::jni::from_jstring_to_string(env, jtarget_path);
56 std::string subject = jau::jni::from_jstring_to_string(env, jsubject);
57 std::string plaintext_version = jau::jni::from_jstring_to_string(env, jplaintext_version);
58 std::string plaintext_version_parent = jau::jni::from_jstring_to_string(env, jplaintext_version_parent);
59 std::string plaintext_hash_algo = jau::jni::from_jstring_to_string(env, jplaintext_hash_algo);
60 std::string destination_fname =
nullptr != jdestination_fname ? jau::jni::from_jstring_to_string(env, jdestination_fname) :
"";
62 cipherpack::PackHeader ph = encryptThenSign(ccfg, enc_pub_keys, sign_sec_key_fname, passphrase, *refSource,
63 target_path, subject, plaintext_version, plaintext_version_parent,
64 refListener.shared_ptr(), plaintext_hash_algo, destination_fname);
65 jau::jni::java_exception_check_and_throw(env, E_FILE_LINE);
77 jobject jsign_pub_keys,
78 jstring jdec_sec_key_fname, jobject jpassphrase,
81 jstring jplaintext_hash_algo,
82 jstring jdestination_fname)
85 jau::jni::shared_ptr_ref<jau::io::ByteStream> refSource(env, jsource_feed);
86 jau::jni::shared_ptr_ref<cipherpack::CipherpackListener> refListener(env, cpListener);
88 std::vector<std::string> sign_pub_keys = jau::jni::convert_jlist_string_to_vector(env, jsign_pub_keys);
89 std::string dec_sec_key_fname = jau::jni::from_jstring_to_string(env, jdec_sec_key_fname);
90 jau::io::secure_string passphrase =
nullptr != jpassphrase ? jau::jni::from_jbytebuffer_to_sstring(env, jpassphrase) : jau::io::secure_string();
91 std::string plaintext_hash_algo = jau::jni::from_jstring_to_string(env, jplaintext_hash_algo);
92 std::string destination_fname =
nullptr != jdestination_fname ? jau::jni::from_jstring_to_string(env, jdestination_fname) :
"";
95 refListener.shared_ptr(), plaintext_hash_algo, destination_fname);
96 jau::jni::java_exception_check_and_throw(env, E_FILE_LINE);
109 jau::jni::shared_ptr_ref<jau::io::ByteStream> refSource(env, jsource_feed);
110 std::string algo = jau::jni::from_jstring_to_string(env, jalgo);
113 if(
nullptr == hash ) {
116 jbyteArray jhash = jau::jni::convert_bytes_to_jbytearray(env, *hash);
126 std::string algo = jau::jni::from_jstring_to_string(env, jalgo);
127 std::string path_or_uri = jau::jni::from_jstring_to_string(env, jpath_or_uri);
128 const jau::fraction_i64 timeout = (int64_t)jtimeoutMS * 1_ms;
130 if(
nullptr == jbytes_hashed ) {
131 throw jau::IllegalArgumentError(
"bytes_hashed null", E_FILE_LINE);
133 const size_t bh_size = env->GetArrayLength(jbytes_hashed);
135 throw jau::IllegalArgumentError(
"bytes_hashed array size "+std::to_string(bh_size)+
" < 1", E_FILE_LINE);
137 jau::jni::JNICriticalArray<uint64_t, jlongArray> criticalArray(env);
138 uint64_t * bh_ptr = criticalArray.get(jbytes_hashed, criticalArray.Mode::UPDATE_AND_RELEASE);
139 if(
nullptr == bh_ptr ) {
140 throw jau::InternalError(
"GetPrimitiveArrayCritical(address byte array) is null", E_FILE_LINE);
144 if(
nullptr == hash ) {
147 jbyteArray jhash = jau::jni::convert_bytes_to_jbytearray(env, *hash);
jobject Java_org_cipherpack_Cipherpack_encryptThenSignImpl1(JNIEnv *env, jclass, jobject jccfg, jobject jenc_pub_keys, jstring jsign_sec_key_fname, jobject jpassphrase, jobject jsource_feed, jstring jtarget_path, jstring jsubject, jstring jplaintext_version, jstring jplaintext_version_parent, jobject cpListener, jstring jplaintext_hash_algo, jstring jdestination_fname)
jobject Java_org_cipherpack_Cipherpack_checkSignThenDecrypt1(JNIEnv *env, jclass, jobject jsign_pub_keys, jstring jdec_sec_key_fname, jobject jpassphrase, jobject jsource_feed, jobject cpListener, jstring jplaintext_hash_algo, jstring jdestination_fname)