This page describes and lists security features and enhancementsadded to Java by major version number, from v1.4 through v6.
NOTE: The APIs and features described in this documentare subject to change.
The following enhancements were added to the Java GSS/Kerberosimplementation in Java SE 6.
des-cbc-md5
des-cbc-crc
des3-cbc-sha1
Starting from Java SE 6, support for AES encryptiontype (AES128 and AES256) in Java GSS/Kerberos is available. Thisimproves interoperability of the Java SE Kerberos implementationwith other Kerberos implementations, such as Solaris 10 and MITKerberos.libdefaults section. It is specified asfollows, with following tags:default_tkt_enctypes,default_tgs_enctypes, permitted_enctypes.aes128-cts
aes128-cts-hmac-sha1-96
(AES256 encryption type)aes256-cts
aes256-cts-hmac-sha1-96
NOTE: The JCE framework within JDK includes anability to enforce restrictions regarding the cryptographicalgorithms and maximum cryptographic strengths available toapplications. Such restrictions are specified in "jurisdictionpolicy files". The jurisdiction policy files bundled in Java SElimits the maximum key length. Hence, in order to use AES256encryption type, you will need to install the JCE crypto policywith the unlimited version to allow AES with 256-bit key.libdefaults section in theconfiguration file might include the following.default_tkt_enctypes = aes128-cts des3-cbc-sha1 des-cbc-md5des-cbc-crc
default_tgs_enctypes = aes128-cts des3-cbc-sha1 des-cbc-md5des-cbc-crc
permitted_enctypes = aes128-cts des3-cbc-sha1 des-cbc-md5des-cbc-crc
default_tkt_enctypes is used to specifythe encryption types to use for the session key in theticket-granting-ticket. It is used by the client to restrict theencryption types of session keys that will be used to communicatewith the KDC. The default value isdes-cbc-md5 des-cbc-crcdes3-cbc-sha1 aes128-cts .default_tgs_enctypes is used to specify the encryptiontypes to use for the session key in service tickets. It is used bythe client to restrict the encryption types of session keys thatare shared by the client and server. The default value isdes-cbc-md5 des-cbc-crc des3-cbc-sha1aes128-cts.permitted_enctypes is used to specify the encryptiontypes permitted to be used by a service. It is used by the serverto restrict the encryption types of session keys that it willaccept. The default value isdes-cbc-md5 des-cbc-crcdes3-cbc-sha1 aes128-cts.des-cbc-md5
des-cbc-crc
des3-cbc-sha1
Starting from Java SE 6, support for RC4-HMACencryption type in Java GSS/Kerberos is available. This improvesinteroperability of the Java SE Kerberos implementation with otherKerberos implementations, such as Windows, Solaris 10 and MITKerberos. Windows Active Directoiory supports RC4-HMAC as thedefault Kerberos encryption type.libdefaults section. It is specified asfollows, with following tags:default_tkt_enctypes,default_tgs_enctypes, permitted_enctypes.rc4-hmac
arcfour-hmac
arcfour-hmac-md5
For example, the libdefaults section in theconfiguration file might include the following.default_tkt_enctypes = aes128-cts des3-cbc-sha1 rc4-hmacdes-cbc-md5 des-cbc-crc
default_tgs_enctypes = aes128-cts des3-cbc-sha1 rc4-hmacdes-cbc-md5 des-cbc-crc
permitted_enctypes = aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5des-cbc-crc
default_tkt_enctypes is used to specifythe encryption types to use for the session key in theticket-granting-ticket. It is used by the client to restrict theencryption types of session keys that will be used to communicatewith the KDC. The default value isdes-cbc-md5 des-cbc-crcrc4-hmac des3-cbc-sha1 aes128-ctsdefault_tgs_enctypes is used to specify the encryptiontypes to use for the session key in service tickets. It is used bythe client to restrict the encryption types of session keys thatare shared by the client and server. The default value isdes-cbc-md5 des-cbc-crc rc4-hmac des3-cbc-sha1aes128-cts.permitted_enctypes is used to specify the encryptiontypes permitted to be used by a service. It is used by the serverto restrict the encryption types of session keys that it willaccept. The default value isdes-cbc-md5 des-cbc-crc rc4-hmacdes3-cbc-sha1 aes128-cts.OID"1.2.840.113554.1.2.2 to use Kerberos mechanism.OidmechOid = new Oid("1.2.840.113554.1.2.2");OID"1.3.6.1.5.5.2".Oid mechOid = newOid("1.3.6.1.5.5.2);This feature allows Java applications to take advantage offeatures in native GSS implementation available on the platform. Toenable Java GSS to delegate to the native GSS library and its listof native mechanisms, set the system property"sun.security.jgss.native" to true. When enabled, Java GSS wouldlook for native GSS library using the operating system specificname, e.g. Solaris: libgss.so vs Linux: libgssapi.so. If thedesired GSS library has a different name or is not located under adirectory for system libraries, then its full path should bespecified using the system property "sun.security.jgss.lib".
For Java SE 6, the native GSS support is limited to Solaris andLinux. Setting these system properties on platforms which nativeGSS integration is not supported will be ignored.
Unlike the default Java GSS implementation which relies on JAASKerberosLoginModule for initial credential acquisition, when usingnative GSS, the initial credential should be acquired beforehand,e.g. kinit, prior to calling JGSS APIs.
In addition, when performing operations as a particular Subject,e.g. Subject.doAs(...) or Subject.doAsPrivileged(...), theto-be-used GSSCredential should be added to Subject's privatecredential set. Otherwise, the GSS operations will fail since nocredential is found.
com.sun.security.jgss.krb5.initiatecom.sun.security.jgss.krb5.accept
The following enhancements were added to the Java GSS/Kerberosimplementation in Java SE 5.0.
Triple DES encryption type is specified in the Kerberosconfiguration file under the "libdefaults" section. It isspecified as "des3-cbc-sha1" with following tags:default_tkt_enctypes,default_tgs_enctypes,permitted_enctypes. "dec3-cbc-sha1" has thefollowing aliases:
des3-hmac-sha1des3-cbc-sha1-kddes3-cbc-hmac-sha1-kdFor example, the libdefaults section in the configuration filemight include the following.
default_tkt_enctypes = des3-cbc-sha1 des-cbc-md5 des-cbc-crcdefault_tgs_enctypes = des3-cbc-sha1 des-cbc-md5 des-cbc-crcpermitted_enctypes = des3-cbc-sha1 des-cbc-md5 des-cbc-crcdefault_tkt_enctypes is used to specify the encryptiontypes to use for the session key in the ticket-granting-ticket. Itis used by the client to restrict the encryption types of sessionkeys that will be used to communicate with the KDC. The defaultvalue is "des-cbc-md5 des-cbc-crc des3-cbc-sha1"
default_tgs_enctypes is used to specify the encryptiontypes to use for the session key in service tickets. It is used bythe client to restrict the encryption types of session keys thatare shared by the client and server. The default value is"des-cbc-md5 des-cbc-crc des3-cbc-sha1".
permitted_enctypes is used to specify the encryptiontypes permitted to be used by a service. It is used by the serverto restrict the encryption types of session keys that it willaccept. The default value is "des-cbc-md5 des-cbc-crcdes3-cbc-sha1".
When sending a message to the KDC, the Java SE Kerberos librarywill use TCP if the size of the message is aboveudp_preference_list. If the message is smaller thanudp_preference_list, then UDP will be tried at most threetimes. If the KDC indicates that the request is too big, the JavaSE Kerberos library will use TCP.
With this feature, ifKrb5LoginModule obtains anexpired ticket from the ticket cache, the TGT will be automaticallyrenewed and be added to Subject of the caller who requested theticket. If the ticket cannot be renewed for any reason, thenKrb5LoginModule will use its configured callback handlerto retrieve a username and password to acquire a new TGT.
To use this feature, configureKrb5LoginModule to usethe ticket cache and set the newly introducedrenewTGToption totrue. Here is an example of a JAAS loginconfiguration file that requests TGT renewal.
server { com.sun.security.auth.module.Krb5LoginModule required principal=principal@your_realm useTicketCache=true renewTGT=true;};Note that ifrenewTGT is set to true, thenuseTicketCache must also be set to true; otherwise, itresults in a configuration error.com.sun.net.ssl.servercom.sun.net.ssl.clientWhen a JSSE application uses the Kerberos cipher suites withoutexplicit JAAS program, the SunJSSE provider will use these indexnames to find and configure the JAAS login module to acquire thenecessary Kerberos credentials. For example, such an applicationmight have the following JAAS configuration file.
com.sun.net.ssl.server { com.sun.security.auth.module.Krb5LoginModule required principal=service_principal@your_realm useKeyTab=true keyTab=keytab_name storeKey=true;};If the entry is not found, the default "other" index name will beused. The service name for TLS is "host". For example, a TLSservice running on a machine named "raven.example.com" in the realmnamed "KRBNT-OPERATIONS.EXAMPLE.COM" would have the serviceprincipal namehost/raven.example.com@KRBNT-OPERATIONS.EXAMPLE.COMThere are no restrictions on the TLS client; it may use any validKerberos principal name.
When a JSSE application uses the Kerberos cipher suites withexplicit JAAS program, it can use any index name, including theones listed above.
java.security.krb5.kdc andjava.security.krb5.realm. In previous releases,changes to the Kerberos configuration values would only take effectwhen an application was restarted.In the 1.4.2 release of the Java platform, a new boolean optionrefreshKrb5Config can be specified in the entry forKrb5LoginModule in the JAAS configuration file. Ifthis option is set totrue, the configuration valueswill be refreshed before thelogin method of theKrb5LoginModule is called.
With this 1.4.2 release, Sun's implementation of Kerberos willretry with the slave KDC(s), if they are specified. The slave KDCscan be specified in the Kerberos configuration file or via a listof KDCs separated by a colon (:) in the systempropertyjava.security.krb5.kdc.
In the current 1.4.2 release, Sun's implementation of Kerberosnow supports automatic fallback to TCP. Therefore, if the Kerberosticket request using UDP fails and the KDC returns the error codeKRB_ERR_RESPONSE_TOO_BIG, TCP is automatically thedefault transport.
Previously, when using Java Generic Security Services (JGSS)over Kerberos V5, if theuseSubjectCredsOnly property was set to true,the Ticket Granting Ticket (TGT) was retrieved from the Subject andused to establish a GSS Security context. The service ticketobtained was not stored in the Subject. Now the service ticket isalso stored in the Subject ifuseSubjectCredsOnly istrue.
If a client application searches through the Subject's privatecredentials, in previous releases it would find only the TGT. As ofthis release, it also will find any Service ticket(s) obtained.
The bug report associated with this change is 4688866.