Java Doc for KerberosKey.java in  » 6.0-JDK-Core » security » javax » security » auth » kerberos » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » security » javax.security.auth.kerberos 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.security.auth.kerberos.KerberosKey

KerberosKey
public class KerberosKey implements SecretKey,Destroyable(Code)
This class encapsulates a long term secret key for a Kerberos principal.

All Kerberos JAAS login modules that obtain a principal's password and generate the secret key from it should use this class. Where available, the login module might even read this secret key directly from a Kerberos "keytab". Sometimes, such as when authenticating a server in the absence of user-to-user authentication, the login module will store an instance of this class in the private credential set of a javax.security.auth.Subject Subject during the commit phase of the authentication process.

It might be necessary for the application to be granted a javax.security.auth.PrivateCredentialPermission PrivateCredentialPermission if it needs to access the KerberosKey instance from a Subject. This permission is not needed when the application depends on the default JGSS Kerberos mechanism to access the KerberosKey. In that case, however, the application will need an appropriate javax.security.auth.kerberos.ServicePermission ServicePermission .
author:
   Mayank Upadhyay
version:
   1.27, 05/05/07
since:
   1.4




Constructor Summary
public  KerberosKey(KerberosPrincipal principal, byte[] keyBytes, int keyType, int versionNum)
     Constructs a KerberosKey from the given bytes when the key type and key version number are known.
public  KerberosKey(KerberosPrincipal principal, char[] password, String algorithm)
     Constructs a KerberosKey from a principal's password.
Parameters:
  principal - the principal that this password belongs to
Parameters:
  password - the password that should be used to compute the key
Parameters:
  algorithm - the name for the algorithm that this key will beused for.

Method Summary
public  voiddestroy()
     Destroys this key.
public  booleanequals(Object other)
     Compares the specified Object with this KerberosKey for equality. Returns true if the given object is also a KerberosKey and the two KerberosKey instances are equivalent.
final public  StringgetAlgorithm()
     Returns the standard algorithm name for this key.
final public  byte[]getEncoded()
     Returns the key material of this secret key.
final public  StringgetFormat()
     Returns the name of the encoding format for this secret key.
final public  intgetKeyType()
     Returns the key type for this long-term key.
final public  KerberosPrincipalgetPrincipal()
     Returns the principal that this key belongs to.
final public  intgetVersionNumber()
     Returns the key version number.
public  inthashCode()
     Returns a hashcode for this KerberosKey.
public  booleanisDestroyed()
     Determines if this key has been destroyed.
public  StringtoString()
    


Constructor Detail
KerberosKey
public KerberosKey(KerberosPrincipal principal, byte[] keyBytes, int keyType, int versionNum)(Code)
Constructs a KerberosKey from the given bytes when the key type and key version number are known. This can be used when reading the secret key information from a Kerberos "keytab".
Parameters:
  principal - the principal that this secret key belongs to
Parameters:
  keyBytes - the raw bytes for the secret key
Parameters:
  keyType - the key type for the secret key as defined by theKerberos protocol specification.
Parameters:
  versionNum - the version number of this secret key



KerberosKey
public KerberosKey(KerberosPrincipal principal, char[] password, String algorithm)(Code)
Constructs a KerberosKey from a principal's password.
Parameters:
  principal - the principal that this password belongs to
Parameters:
  password - the password that should be used to compute the key
Parameters:
  algorithm - the name for the algorithm that this key will beused for. This parameter may be null in which case the defaultalgorithm "DES" will be assumed.
throws:
  IllegalArgumentException - if the name of the algorithm passed is unsupported.




Method Detail
destroy
public void destroy() throws DestroyFailedException(Code)
Destroys this key. A call to any of its other methods after this will cause an IllegalStateException to be thrown.
throws:
  DestroyFailedException - if some error occurs while destorying this key.



equals
public boolean equals(Object other)(Code)
Compares the specified Object with this KerberosKey for equality. Returns true if the given object is also a KerberosKey and the two KerberosKey instances are equivalent.
Parameters:
  other - the Object to compare to true if the specified object is equal to this KerberosKey,false otherwise. NOTE: Returns false if either of the KerberosKeyobjects has been destroyed.
since:
   1.6



getAlgorithm
final public String getAlgorithm()(Code)
Returns the standard algorithm name for this key. For example, "DES" would indicate that this key is a DES key. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names. the name of the algorithm associated with this key.



getEncoded
final public byte[] getEncoded()(Code)
Returns the key material of this secret key. the key material



getFormat
final public String getFormat()(Code)
Returns the name of the encoding format for this secret key. the String "RAW"



getKeyType
final public int getKeyType()(Code)
Returns the key type for this long-term key. the key type.



getPrincipal
final public KerberosPrincipal getPrincipal()(Code)
Returns the principal that this key belongs to. the principal this key belongs to.



getVersionNumber
final public int getVersionNumber()(Code)
Returns the key version number. the key version number.



hashCode
public int hashCode()(Code)
Returns a hashcode for this KerberosKey. a hashCode() for the KerberosKey
since:
   1.6



isDestroyed
public boolean isDestroyed()(Code)
Determines if this key has been destroyed.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.