示例#1
0
extern "C" NS_EXPORT jstring JNICALL
Java_org_mozilla_gecko_NSSBridge_nativeEncrypt(JNIEnv* jenv, jclass,
                                               jstring jPath,
                                               jstring jValue)
{
    jstring ret = jenv->NewStringUTF("");

    const char* path;
    path = jenv->GetStringUTFChars(jPath, nullptr);

    const char* value;
    value = jenv->GetStringUTFChars(jValue, nullptr);

    char* result;
    SECStatus rv = doCrypto(jenv, path, value, &result, true);
    if (rv == SECSuccess) {
      ret = jenv->NewStringUTF(result);
      free(result);
    }

    jenv->ReleaseStringUTFChars(jValue, value);
    jenv->ReleaseStringUTFChars(jPath, path);

    return ret;
}
示例#2
0
void BlowfishCrypto::Decrypt(const TCHAR *cipherText, TCHAR *clearText)
{
	doCrypto(cipherText, clearText, &this->decrypt);
}
示例#3
0
void BlowfishCrypto::Encrypt(const TCHAR *clearText, TCHAR *cipherText)
{
	doCrypto(clearText,cipherText, &this->encrypt);
}