📄 java_jni.c
字号:
#include "../crypt.h"#ifdef USE_JAVA#include <jni.h>#include <stdio.h> //printf#include <stdlib.h> //malloc, free#undef cryptlib_crypt_ALGO_NONE#define cryptlib_crypt_ALGO_NONE 0L#undef cryptlib_crypt_ALGO_DES#define cryptlib_crypt_ALGO_DES 1L#undef cryptlib_crypt_ALGO_3DES#define cryptlib_crypt_ALGO_3DES 2L#undef cryptlib_crypt_ALGO_IDEA#define cryptlib_crypt_ALGO_IDEA 3L#undef cryptlib_crypt_ALGO_CAST#define cryptlib_crypt_ALGO_CAST 4L#undef cryptlib_crypt_ALGO_RC2#define cryptlib_crypt_ALGO_RC2 5L#undef cryptlib_crypt_ALGO_RC4#define cryptlib_crypt_ALGO_RC4 6L#undef cryptlib_crypt_ALGO_RC5#define cryptlib_crypt_ALGO_RC5 7L#undef cryptlib_crypt_ALGO_AES#define cryptlib_crypt_ALGO_AES 8L#undef cryptlib_crypt_ALGO_BLOWFISH#define cryptlib_crypt_ALGO_BLOWFISH 9L#undef cryptlib_crypt_ALGO_SKIPJACK#define cryptlib_crypt_ALGO_SKIPJACK 10L#undef cryptlib_crypt_ALGO_DH#define cryptlib_crypt_ALGO_DH 100L#undef cryptlib_crypt_ALGO_RSA#define cryptlib_crypt_ALGO_RSA 101L#undef cryptlib_crypt_ALGO_DSA#define cryptlib_crypt_ALGO_DSA 102L#undef cryptlib_crypt_ALGO_ELGAMAL#define cryptlib_crypt_ALGO_ELGAMAL 103L#undef cryptlib_crypt_ALGO_KEA#define cryptlib_crypt_ALGO_KEA 104L#undef cryptlib_crypt_ALGO_MD2#define cryptlib_crypt_ALGO_MD2 200L#undef cryptlib_crypt_ALGO_MD4#define cryptlib_crypt_ALGO_MD4 201L#undef cryptlib_crypt_ALGO_MD5#define cryptlib_crypt_ALGO_MD5 202L#undef cryptlib_crypt_ALGO_SHA#define cryptlib_crypt_ALGO_SHA 203L#undef cryptlib_crypt_ALGO_RIPEMD160#define cryptlib_crypt_ALGO_RIPEMD160 204L#undef cryptlib_crypt_ALGO_SHA2#define cryptlib_crypt_ALGO_SHA2 205L#undef cryptlib_crypt_ALGO_HMAC_MD5#define cryptlib_crypt_ALGO_HMAC_MD5 300L#undef cryptlib_crypt_ALGO_HMAC_SHA#define cryptlib_crypt_ALGO_HMAC_SHA 301L#undef cryptlib_crypt_ALGO_HMAC_RIPEMD160#define cryptlib_crypt_ALGO_HMAC_RIPEMD160 302L#undef cryptlib_crypt_ALGO_LAST#define cryptlib_crypt_ALGO_LAST 303L#undef cryptlib_crypt_ALGO_FIRST_CONVENTIONAL#define cryptlib_crypt_ALGO_FIRST_CONVENTIONAL 1L#undef cryptlib_crypt_ALGO_LAST_CONVENTIONAL#define cryptlib_crypt_ALGO_LAST_CONVENTIONAL 99L#undef cryptlib_crypt_ALGO_FIRST_PKC#define cryptlib_crypt_ALGO_FIRST_PKC 100L#undef cryptlib_crypt_ALGO_LAST_PKC#define cryptlib_crypt_ALGO_LAST_PKC 199L#undef cryptlib_crypt_ALGO_FIRST_HASH#define cryptlib_crypt_ALGO_FIRST_HASH 200L#undef cryptlib_crypt_ALGO_LAST_HASH#define cryptlib_crypt_ALGO_LAST_HASH 299L#undef cryptlib_crypt_ALGO_FIRST_MAC#define cryptlib_crypt_ALGO_FIRST_MAC 300L#undef cryptlib_crypt_ALGO_LAST_MAC#define cryptlib_crypt_ALGO_LAST_MAC 399L#undef cryptlib_crypt_MODE_NONE#define cryptlib_crypt_MODE_NONE 0L#undef cryptlib_crypt_MODE_ECB#define cryptlib_crypt_MODE_ECB 1L#undef cryptlib_crypt_MODE_CBC#define cryptlib_crypt_MODE_CBC 2L#undef cryptlib_crypt_MODE_CFB#define cryptlib_crypt_MODE_CFB 3L#undef cryptlib_crypt_MODE_OFB#define cryptlib_crypt_MODE_OFB 4L#undef cryptlib_crypt_MODE_LAST#define cryptlib_crypt_MODE_LAST 5L#undef cryptlib_crypt_KEYSET_NONE#define cryptlib_crypt_KEYSET_NONE 0L#undef cryptlib_crypt_KEYSET_FILE#define cryptlib_crypt_KEYSET_FILE 1L#undef cryptlib_crypt_KEYSET_HTTP#define cryptlib_crypt_KEYSET_HTTP 2L#undef cryptlib_crypt_KEYSET_LDAP#define cryptlib_crypt_KEYSET_LDAP 3L#undef cryptlib_crypt_KEYSET_ODBC#define cryptlib_crypt_KEYSET_ODBC 4L#undef cryptlib_crypt_KEYSET_DATABASE#define cryptlib_crypt_KEYSET_DATABASE 5L#undef cryptlib_crypt_KEYSET_PLUGIN#define cryptlib_crypt_KEYSET_PLUGIN 6L#undef cryptlib_crypt_KEYSET_ODBC_STORE#define cryptlib_crypt_KEYSET_ODBC_STORE 7L#undef cryptlib_crypt_KEYSET_DATABASE_STORE#define cryptlib_crypt_KEYSET_DATABASE_STORE 8L#undef cryptlib_crypt_KEYSET_PLUGIN_STORE#define cryptlib_crypt_KEYSET_PLUGIN_STORE 9L#undef cryptlib_crypt_KEYSET_LAST#define cryptlib_crypt_KEYSET_LAST 10L#undef cryptlib_crypt_DEVICE_NONE#define cryptlib_crypt_DEVICE_NONE 0L#undef cryptlib_crypt_DEVICE_FORTEZZA#define cryptlib_crypt_DEVICE_FORTEZZA 1L#undef cryptlib_crypt_DEVICE_PKCS11#define cryptlib_crypt_DEVICE_PKCS11 2L#undef cryptlib_crypt_DEVICE_CRYPTOAPI#define cryptlib_crypt_DEVICE_CRYPTOAPI 3L#undef cryptlib_crypt_DEVICE_LAST#define cryptlib_crypt_DEVICE_LAST 4L#undef cryptlib_crypt_CERTTYPE_NONE#define cryptlib_crypt_CERTTYPE_NONE 0L#undef cryptlib_crypt_CERTTYPE_CERTIFICATE#define cryptlib_crypt_CERTTYPE_CERTIFICATE 1L#undef cryptlib_crypt_CERTTYPE_ATTRIBUTE_CERT#define cryptlib_crypt_CERTTYPE_ATTRIBUTE_CERT 2L#undef cryptlib_crypt_CERTTYPE_CERTCHAIN#define cryptlib_crypt_CERTTYPE_CERTCHAIN 3L#undef cryptlib_crypt_CERTTYPE_CERTREQUEST#define cryptlib_crypt_CERTTYPE_CERTREQUEST 4L#undef cryptlib_crypt_CERTTYPE_REQUEST_CERT#define cryptlib_crypt_CERTTYPE_REQUEST_CERT 5L#undef cryptlib_crypt_CERTTYPE_REQUEST_REVOCATION#define cryptlib_crypt_CERTTYPE_REQUEST_REVOCATION 6L#undef cryptlib_crypt_CERTTYPE_CRL#define cryptlib_crypt_CERTTYPE_CRL 7L#undef cryptlib_crypt_CERTTYPE_CMS_ATTRIBUTES#define cryptlib_crypt_CERTTYPE_CMS_ATTRIBUTES 8L#undef cryptlib_crypt_CERTTYPE_RTCS_REQUEST#define cryptlib_crypt_CERTTYPE_RTCS_REQUEST 9L#undef cryptlib_crypt_CERTTYPE_RTCS_RESPONSE#define cryptlib_crypt_CERTTYPE_RTCS_RESPONSE 10L#undef cryptlib_crypt_CERTTYPE_OCSP_REQUEST#define cryptlib_crypt_CERTTYPE_OCSP_REQUEST 11L#undef cryptlib_crypt_CERTTYPE_OCSP_RESPONSE#define cryptlib_crypt_CERTTYPE_OCSP_RESPONSE 12L#undef cryptlib_crypt_CERTTYPE_PKIUSER#define cryptlib_crypt_CERTTYPE_PKIUSER 13L#undef cryptlib_crypt_CERTTYPE_LAST#define cryptlib_crypt_CERTTYPE_LAST 14L#undef cryptlib_crypt_FORMAT_NONE#define cryptlib_crypt_FORMAT_NONE 0L#undef cryptlib_crypt_FORMAT_AUTO#define cryptlib_crypt_FORMAT_AUTO 1L#undef cryptlib_crypt_FORMAT_CRYPTLIB#define cryptlib_crypt_FORMAT_CRYPTLIB 2L#undef cryptlib_crypt_FORMAT_CMS#define cryptlib_crypt_FORMAT_CMS 3L#undef cryptlib_crypt_FORMAT_PKCS7#define cryptlib_crypt_FORMAT_PKCS7 3L#undef cryptlib_crypt_FORMAT_SMIME#define cryptlib_crypt_FORMAT_SMIME 4L#undef cryptlib_crypt_FORMAT_PGP#define cryptlib_crypt_FORMAT_PGP 5L#undef cryptlib_crypt_FORMAT_LAST#define cryptlib_crypt_FORMAT_LAST 6L#undef cryptlib_crypt_SESSION_NONE#define cryptlib_crypt_SESSION_NONE 0L#undef cryptlib_crypt_SESSION_SSH#define cryptlib_crypt_SESSION_SSH 1L#undef cryptlib_crypt_SESSION_SSH_SERVER#define cryptlib_crypt_SESSION_SSH_SERVER 2L#undef cryptlib_crypt_SESSION_SSL#define cryptlib_crypt_SESSION_SSL 3L#undef cryptlib_crypt_SESSION_SSL_SERVER#define cryptlib_crypt_SESSION_SSL_SERVER 4L#undef cryptlib_crypt_SESSION_RTCS#define cryptlib_crypt_SESSION_RTCS 5L#undef cryptlib_crypt_SESSION_RTCS_SERVER#define cryptlib_crypt_SESSION_RTCS_SERVER 6L#undef cryptlib_crypt_SESSION_OCSP#define cryptlib_crypt_SESSION_OCSP 7L#undef cryptlib_crypt_SESSION_OCSP_SERVER#define cryptlib_crypt_SESSION_OCSP_SERVER 8L#undef cryptlib_crypt_SESSION_TSP#define cryptlib_crypt_SESSION_TSP 9L#undef cryptlib_crypt_SESSION_TSP_SERVER#define cryptlib_crypt_SESSION_TSP_SERVER 10L#undef cryptlib_crypt_SESSION_CMP#define cryptlib_crypt_SESSION_CMP 11L#undef cryptlib_crypt_SESSION_CMP_SERVER#define cryptlib_crypt_SESSION_CMP_SERVER 12L#undef cryptlib_crypt_SESSION_SCEP#define cryptlib_crypt_SESSION_SCEP 13L#undef cryptlib_crypt_SESSION_SCEP_SERVER#define cryptlib_crypt_SESSION_SCEP_SERVER 14L#undef cryptlib_crypt_SESSION_CERTSTORE_SERVER#define cryptlib_crypt_SESSION_CERTSTORE_SERVER 15L#undef cryptlib_crypt_SESSION_LAST#define cryptlib_crypt_SESSION_LAST 16L#undef cryptlib_crypt_USER_NONE#define cryptlib_crypt_USER_NONE 0L#undef cryptlib_crypt_USER_NORMAL#define cryptlib_crypt_USER_NORMAL 1L#undef cryptlib_crypt_USER_SO#define cryptlib_crypt_USER_SO 2L#undef cryptlib_crypt_USER_CA#define cryptlib_crypt_USER_CA 3L#undef cryptlib_crypt_USER_LAST#define cryptlib_crypt_USER_LAST 4L#undef cryptlib_crypt_ATTRIBUTE_NONE#define cryptlib_crypt_ATTRIBUTE_NONE 0L#undef cryptlib_crypt_PROPERTY_FIRST#define cryptlib_crypt_PROPERTY_FIRST 1L#undef cryptlib_crypt_PROPERTY_HIGHSECURITY#define cryptlib_crypt_PROPERTY_HIGHSECURITY 2L#undef cryptlib_crypt_PROPERTY_OWNER#define cryptlib_crypt_PROPERTY_OWNER 3L#undef cryptlib_crypt_PROPERTY_FORWARDCOUNT#define cryptlib_crypt_PROPERTY_FORWARDCOUNT 4L#undef cryptlib_crypt_PROPERTY_LOCKED#define cryptlib_crypt_PROPERTY_LOCKED 5L#undef cryptlib_crypt_PROPERTY_USAGECOUNT#define cryptlib_crypt_PROPERTY_USAGECOUNT 6L#undef cryptlib_crypt_PROPERTY_NONEXPORTABLE#define cryptlib_crypt_PROPERTY_NONEXPORTABLE 7L#undef cryptlib_crypt_PROPERTY_LAST#define cryptlib_crypt_PROPERTY_LAST 8L#undef cryptlib_crypt_GENERIC_FIRST#define cryptlib_crypt_GENERIC_FIRST 9L#undef cryptlib_crypt_ATTRIBUTE_ERRORTYPE#define cryptlib_crypt_ATTRIBUTE_ERRORTYPE 10L#undef cryptlib_crypt_ATTRIBUTE_ERRORLOCUS#define cryptlib_crypt_ATTRIBUTE_ERRORLOCUS 11L#undef cryptlib_crypt_ATTRIBUTE_INT_ERRORCODE#define cryptlib_crypt_ATTRIBUTE_INT_ERRORCODE 12L#undef cryptlib_crypt_ATTRIBUTE_INT_ERRORMESSAGE#define cryptlib_crypt_ATTRIBUTE_INT_ERRORMESSAGE 13L#undef cryptlib_crypt_ATTRIBUTE_CURRENT_GROUP#define cryptlib_crypt_ATTRIBUTE_CURRENT_GROUP 14L#undef cryptlib_crypt_ATTRIBUTE_CURRENT#define cryptlib_crypt_ATTRIBUTE_CURRENT 15L#undef cryptlib_crypt_ATTRIBUTE_CURRENT_INSTANCE#define cryptlib_crypt_ATTRIBUTE_CURRENT_INSTANCE 16L#undef cryptlib_crypt_ATTRIBUTE_BUFFERSIZE#define cryptlib_crypt_ATTRIBUTE_BUFFERSIZE 17L#undef cryptlib_crypt_GENERIC_LAST#define cryptlib_crypt_GENERIC_LAST 18L#undef cryptlib_crypt_OPTION_FIRST#define cryptlib_crypt_OPTION_FIRST 100L#undef cryptlib_crypt_OPTION_INFO_DESCRIPTION#define cryptlib_crypt_OPTION_INFO_DESCRIPTION 101L#undef cryptlib_crypt_OPTION_INFO_COPYRIGHT#define cryptlib_crypt_OPTION_INFO_COPYRIGHT 102L#undef cryptlib_crypt_OPTION_INFO_MAJORVERSION#define cryptlib_crypt_OPTION_INFO_MAJORVERSION 103L#undef cryptlib_crypt_OPTION_INFO_MINORVERSION#define cryptlib_crypt_OPTION_INFO_MINORVERSION 104L#undef cryptlib_crypt_OPTION_INFO_STEPPING#define cryptlib_crypt_OPTION_INFO_STEPPING 105L#undef cryptlib_crypt_OPTION_ENCR_ALGO#define cryptlib_crypt_OPTION_ENCR_ALGO 106L#undef cryptlib_crypt_OPTION_ENCR_HASH#define cryptlib_crypt_OPTION_ENCR_HASH 107L#undef cryptlib_crypt_OPTION_ENCR_MAC#define cryptlib_crypt_OPTION_ENCR_MAC 108L#undef cryptlib_crypt_OPTION_PKC_ALGO#define cryptlib_crypt_OPTION_PKC_ALGO 109L#undef cryptlib_crypt_OPTION_PKC_KEYSIZE#define cryptlib_crypt_OPTION_PKC_KEYSIZE 110L#undef cryptlib_crypt_OPTION_SIG_ALGO#define cryptlib_crypt_OPTION_SIG_ALGO 111L#undef cryptlib_crypt_OPTION_SIG_KEYSIZE#define cryptlib_crypt_OPTION_SIG_KEYSIZE 112L#undef cryptlib_crypt_OPTION_KEYING_ALGO#define cryptlib_crypt_OPTION_KEYING_ALGO 113L
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -