FileDocCategorySizeDatePackage
SSL.javaAPI DocApache Tomcat 6.0.1414968Fri Jul 20 04:20:36 BST 2007org.apache.tomcat.jni

SSL

public final class SSL extends Object
SSL
author
Mladen Turk
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static final int
UNSET
public static final int
SSL_ALGO_UNKNOWN
public static final int
SSL_ALGO_RSA
public static final int
SSL_ALGO_DSA
public static final int
SSL_ALGO_ALL
public static final int
SSL_AIDX_RSA
public static final int
SSL_AIDX_DSA
public static final int
SSL_AIDX_MAX
public static final int
SSL_TMP_KEY_RSA_512
public static final int
SSL_TMP_KEY_RSA_1024
public static final int
SSL_TMP_KEY_RSA_2048
public static final int
SSL_TMP_KEY_RSA_4096
public static final int
SSL_TMP_KEY_DH_512
public static final int
SSL_TMP_KEY_DH_1024
public static final int
SSL_TMP_KEY_DH_2048
public static final int
SSL_TMP_KEY_DH_4096
public static final int
SSL_TMP_KEY_MAX
public static final int
SSL_OPT_NONE
public static final int
SSL_OPT_RELSET
public static final int
SSL_OPT_STDENVVARS
public static final int
SSL_OPT_EXPORTCERTDATA
public static final int
SSL_OPT_FAKEBASICAUTH
public static final int
SSL_OPT_STRICTREQUIRE
public static final int
SSL_OPT_OPTRENEGOTIATE
public static final int
SSL_OPT_ALL
public static final int
SSL_PROTOCOL_NONE
public static final int
SSL_PROTOCOL_SSLV2
public static final int
SSL_PROTOCOL_SSLV3
public static final int
SSL_PROTOCOL_TLSV1
public static final int
SSL_PROTOCOL_ALL
public static final int
SSL_CVERIFY_UNSET
public static final int
SSL_CVERIFY_NONE
public static final int
SSL_CVERIFY_OPTIONAL
public static final int
SSL_CVERIFY_REQUIRE
public static final int
SSL_CVERIFY_OPTIONAL_NO_CA
public static final int
SSL_VERIFY_NONE
public static final int
SSL_VERIFY_PEER
public static final int
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
public static final int
SSL_VERIFY_CLIENT_ONCE
public static final int
SSL_VERIFY_PEER_STRICT
public static final int
SSL_OP_MICROSOFT_SESS_ID_BUG
public static final int
SSL_OP_NETSCAPE_CHALLENGE_BUG
public static final int
SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
public static final int
SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
public static final int
SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
public static final int
SSL_OP_MSIE_SSLV2_RSA_PADDING
public static final int
SSL_OP_SSLEAY_080_CLIENT_DH_BUG
public static final int
SSL_OP_TLS_D5_BUG
public static final int
SSL_OP_TLS_BLOCK_PADDING_BUG
public static final int
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
public static final int
SSL_OP_ALL
public static final int
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
public static final int
SSL_OP_SINGLE_DH_USE
public static final int
SSL_OP_EPHEMERAL_RSA
public static final int
SSL_OP_CIPHER_SERVER_PREFERENCE
public static final int
SSL_OP_TLS_ROLLBACK_BUG
public static final int
SSL_OP_NO_SSLv2
public static final int
SSL_OP_NO_SSLv3
public static final int
SSL_OP_NO_TLSv1
public static final int
SSL_OP_PKCS1_CHECK_1
public static final int
SSL_OP_PKCS1_CHECK_2
public static final int
SSL_OP_NETSCAPE_CA_DN_BUG
public static final int
SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
public static final int
SSL_CRT_FORMAT_UNDEF
public static final int
SSL_CRT_FORMAT_ASN1
public static final int
SSL_CRT_FORMAT_TEXT
public static final int
SSL_CRT_FORMAT_PEM
public static final int
SSL_CRT_FORMAT_NETSCAPE
public static final int
SSL_CRT_FORMAT_PKCS12
public static final int
SSL_CRT_FORMAT_SMIME
public static final int
SSL_CRT_FORMAT_ENGINE
public static final int
SSL_MODE_CLIENT
public static final int
SSL_MODE_SERVER
public static final int
SSL_MODE_COMBINED
public static final int
SSL_SHUTDOWN_TYPE_UNSET
public static final int
SSL_SHUTDOWN_TYPE_STANDARD
public static final int
SSL_SHUTDOWN_TYPE_UNCLEAN
public static final int
SSL_SHUTDOWN_TYPE_ACCURATE
public static final int
SSL_INFO_SESSION_ID
public static final int
SSL_INFO_CIPHER
public static final int
SSL_INFO_CIPHER_USEKEYSIZE
public static final int
SSL_INFO_CIPHER_ALGKEYSIZE
public static final int
SSL_INFO_CIPHER_VERSION
public static final int
SSL_INFO_CIPHER_DESCRIPTION
public static final int
SSL_INFO_PROTOCOL
public static final int
SSL_INFO_CLIENT_S_DN
public static final int
SSL_INFO_CLIENT_I_DN
public static final int
SSL_INFO_SERVER_S_DN
public static final int
SSL_INFO_SERVER_I_DN
public static final int
SSL_INFO_DN_COUNTRYNAME
public static final int
SSL_INFO_DN_STATEORPROVINCENAME
public static final int
SSL_INFO_DN_LOCALITYNAME
public static final int
SSL_INFO_DN_ORGANIZATIONNAME
public static final int
SSL_INFO_DN_ORGANIZATIONALUNITNAME
public static final int
SSL_INFO_DN_COMMONNAME
public static final int
SSL_INFO_DN_TITLE
public static final int
SSL_INFO_DN_INITIALS
public static final int
SSL_INFO_DN_GIVENNAME
public static final int
SSL_INFO_DN_SURNAME
public static final int
SSL_INFO_DN_DESCRIPTION
public static final int
SSL_INFO_DN_UNIQUEIDENTIFIER
public static final int
SSL_INFO_DN_EMAILADDRESS
public static final int
SSL_INFO_CLIENT_M_VERSION
public static final int
SSL_INFO_CLIENT_M_SERIAL
public static final int
SSL_INFO_CLIENT_V_START
public static final int
SSL_INFO_CLIENT_V_END
public static final int
SSL_INFO_CLIENT_A_SIG
public static final int
SSL_INFO_CLIENT_A_KEY
public static final int
SSL_INFO_CLIENT_CERT
public static final int
SSL_INFO_CLIENT_V_REMAIN
public static final int
SSL_INFO_SERVER_M_VERSION
public static final int
SSL_INFO_SERVER_M_SERIAL
public static final int
SSL_INFO_SERVER_V_START
public static final int
SSL_INFO_SERVER_V_END
public static final int
SSL_INFO_SERVER_A_SIG
public static final int
SSL_INFO_SERVER_A_KEY
public static final int
SSL_INFO_SERVER_CERT
public static final int
SSL_INFO_CLIENT_CERT_CHAIN
Constructors Summary
Methods Summary
public static native intcloseBIO(long bio)
Close BIO and derefrence callback object

param
bio BIO to close and destroy.
return
APR Status code

public static native booleangenerateRSATempKey(int idx)
Generate temporary RSA key.
Index can be one of:
SSL_TMP_KEY_RSA_512
SSL_TMP_KEY_RSA_1024
SSL_TMP_KEY_RSA_2048
SSL_TMP_KEY_RSA_4096
By default 512 and 1024 keys are generated on startup. You can use a low priority thread to generate them on the fly.

param
idx temporary key index.

public static native java.lang.StringgetLastError()
Return last SSL error string

public static native intinitialize(java.lang.String engine)
Initialize OpenSSL support. This function needs to be called once for the lifetime of JVM. Library.init() has to be called before.

param
engine Support for external a Crypto Device ("engine"), usually a hardware accellerator card for crypto operations.
return
APR status code

public static native booleanloadDSATempKey(int idx, java.lang.String file)
Load temporary DSA key from file
Index can be one of:
SSL_TMP_KEY_DH_512
SSL_TMP_KEY_DH_1024
SSL_TMP_KEY_DH_2048
SSL_TMP_KEY_DH_4096

param
idx temporary key index.
param
file File contatining DH params.

public static native longnewBIO(long pool, BIOCallback callback)
Initialize new BIO

param
pool The pool to use.
param
callback BIOCallback to use
return
New BIO handle

public static native booleanrandLoad(java.lang.String filename)
Add content of the file to the PRNG

param
filename Filename containing random data. If null the default file will be tested. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. In case both files are unavailable builtin random seed generator is used.

public static native booleanrandMake(java.lang.String filename, int len, boolean base64)
Creates random data to filename

param
filename Filename to save the data
param
len The length of random sequence in bytes
param
base64 Output the data in Base64 encoded format

public static native booleanrandSave(java.lang.String filename)
Writes a number of random bytes (currently 1024) to file filename which can be used to initialize the PRNG by calling randLoad in a later session.

param
filename Filename to save the data

public static native voidsetPassword(java.lang.String password)
Set global Password for decrypting certificates and keys.

param
password Password to use.

public static native voidsetPasswordCallback(PasswordCallback callback)
Set global Password callback for obtaining passwords.

param
callback PasswordCallback implementation to use.

public static native intversion()

public static native java.lang.StringversionString()