|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--org.apache.catalina.realm.RealmBase
Simple implementation of Realm that reads an XML file to configure the valid users, passwords, and roles. The file format (and default file location) are identical to those currently supported by Tomcat 3.X.
フィールドの概要 | |
protected Container |
container
The Container with which this Realm is associated. |
protected int |
debug
The debugging detail level for this component. |
protected java.lang.String |
digest
Digest algorithm used in storing passwords in a non-plaintext format. |
protected static java.lang.String |
info
Descriptive information about this Realm implementation. |
protected LifecycleSupport |
lifecycle
The lifecycle event support for this component. |
protected java.security.MessageDigest |
md
The MessageDigest object for digesting user credentials (passwords). |
protected static MD5Encoder |
md5Encoder
The MD5 helper object for this class. |
protected static java.security.MessageDigest |
md5Helper
MD5 message digest provider. |
protected static StringManager |
sm
The string manager for this package. |
protected boolean |
started
Has this component been started? |
protected java.beans.PropertyChangeSupport |
support
The property change support for this component. |
protected boolean |
validate
Should we validate client certificate chains when they are presented? |
インタフェース org.apache.catalina.Lifecycle から継承したフィールド |
START_EVENT, STOP_EVENT |
コンストラクタの概要 | |
RealmBase()
|
メソッドの概要 | |
void |
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
java.security.Principal |
authenticate(java.lang.String username,
byte[] credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null . |
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null . |
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String clientDigest,
java.lang.String nOnce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realm,
java.lang.String md5a2)
Return the Principal associated with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 2069; otherwise return null . |
java.security.Principal |
authenticate(java.security.cert.X509Certificate[] certs)
Return the Principal associated with the specified chain of X509 client certificates. |
protected java.lang.String |
digest(java.lang.String credentials)
Digest the password using the specified algorithm and convert the result to a corresponding hexadecimal string. |
static java.lang.String |
Digest(java.lang.String credentials,
java.lang.String algorithm)
Digest password using the algorithm especificied and convert the result to a corresponding hex string. |
Container |
getContainer()
Return the Container with which this Realm has been associated. |
int |
getDebug()
Return the debugging detail level for this component. |
java.lang.String |
getDigest()
Return the digest algorithm used for storing credentials. |
protected java.lang.String |
getDigest(java.lang.String username,
java.lang.String realmName)
Return the digest associated with given principal's user name. |
java.lang.String |
getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version> . |
protected abstract java.lang.String |
getName()
Return a short name for this Realm implementation, for use in log messages. |
protected abstract java.lang.String |
getPassword(java.lang.String username)
Return the password associated with the given principal's user name. |
protected abstract java.security.Principal |
getPrincipal(java.lang.String username)
Return the Principal associated with the given user name. |
boolean |
getValidate()
Return the "validate certificate chains" flag. |
protected boolean |
hasMessageDigest()
|
boolean |
hasRole(java.security.Principal principal,
java.lang.String role)
Return true if the specified Principal has the specified
security role, within the context of this Realm; otherwise return
false . |
protected void |
log(java.lang.String message)
Log a message on the Logger associated with our Container (if any) |
protected void |
log(java.lang.String message,
java.lang.Throwable throwable)
Log a message on the Logger associated with our Container (if any) |
static void |
main(java.lang.String[] args)
Digest password using the algorithm especificied and convert the result to a corresponding hex string. |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setContainer(Container container)
Set the Container with which this Realm has been associated. |
void |
setDebug(int debug)
Set the debugging detail level for this component. |
void |
setDigest(java.lang.String digest)
Set the digest algorithm used for storing credentials. |
void |
setValidate(boolean validate)
Set the "validate certificate chains" flag. |
void |
start()
Prepare for the beginning of active use of the public methods of this component. |
void |
stop()
Gracefully terminate the active use of the public methods of this component. |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
protected Container container
protected int debug
protected java.lang.String digest
null
if no digesting should
be performed.protected static final java.lang.String info
protected LifecycleSupport lifecycle
protected java.security.MessageDigest md
protected static final MD5Encoder md5Encoder
protected static java.security.MessageDigest md5Helper
protected static StringManager sm
protected boolean started
protected java.beans.PropertyChangeSupport support
protected boolean validate
コンストラクタの詳細 |
public RealmBase()
メソッドの詳細 |
public Container getContainer()
Realm
内の getContainer
public void setContainer(Container container)
Realm
内の setContainer
container
- The associated Containerpublic int getDebug()
public void setDebug(int debug)
debug
- The new debugging detail levelpublic java.lang.String getDigest()
public void setDigest(java.lang.String digest)
digest
- The new digest algorithmpublic java.lang.String getInfo()
<description>/<version>
.Realm
内の getInfo
public boolean getValidate()
public void setValidate(boolean validate)
validate
- The new validate certificate chains flagpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Realm
内の addPropertyChangeListener
listener
- The listener to addpublic java.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
null
.Realm
内の authenticate
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in
authenticating this usernamepublic java.security.Principal authenticate(java.lang.String username, byte[] credentials)
null
.Realm
内の authenticate
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in
authenticating this usernamepublic java.security.Principal authenticate(java.lang.String username, java.lang.String clientDigest, java.lang.String nOnce, java.lang.String nc, java.lang.String cnonce, java.lang.String qop, java.lang.String realm, java.lang.String md5a2)
null
.Realm
内の authenticate
username
- Username of the Principal to look upclientDigest
- Digest which has been submitted by the clientnOnce
- Unique (or supposedly unique) token which has been used
for this requestrealm
- Realm namemd5a2
- Second MD5 digest used to calculate the digest :
MD5(Method + ":" + uri)public java.security.Principal authenticate(java.security.cert.X509Certificate[] certs)
null
.Realm
内の authenticate
certs
- Array of client certificates, with the first one in
the array being the certificate of the client itself.public boolean hasRole(java.security.Principal principal, java.lang.String role)
true
if the specified Principal has the specified
security role, within the context of this Realm; otherwise return
false
. This method can be overridden by Realm
implementations, but the default is adequate when an instance of
GenericPrincipal
is used to represent authenticated
Principals from this Realm.Realm
内の hasRole
principal
- Principal for whom the role is to be checkedrole
- Security role to be checkedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Realm
内の removePropertyChangeListener
listener
- The listener to removepublic void addLifecycleListener(LifecycleListener listener)
Lifecycle
内の addLifecycleListener
listener
- The listener to addpublic void removeLifecycleListener(LifecycleListener listener)
Lifecycle
内の removeLifecycleListener
listener
- The listener to removepublic void start() throws LifecycleException
Lifecycle
内の start
java.lang.IllegalStateException
- if this component has already been
startedLifecycleException
- if this component detects a fatal error
that prevents this component from being usedpublic void stop() throws LifecycleException
Lifecycle
内の stop
java.lang.IllegalStateException
- if this component has not been startedLifecycleException
- if this component detects a fatal error
that needs to be reportedprotected java.lang.String digest(java.lang.String credentials)
credentials
- Password or other credentials to use in
authenticating this usernameprotected boolean hasMessageDigest()
protected java.lang.String getDigest(java.lang.String username, java.lang.String realmName)
protected abstract java.lang.String getName()
protected abstract java.lang.String getPassword(java.lang.String username)
protected abstract java.security.Principal getPrincipal(java.lang.String username)
protected void log(java.lang.String message)
message
- Message to be loggedprotected void log(java.lang.String message, java.lang.Throwable throwable)
message
- Message to be loggedthrowable
- Associated exceptionpublic static final java.lang.String Digest(java.lang.String credentials, java.lang.String algorithm)
credentials
- Password or other credentials to use in
authenticating this usernamealgorithm
- Algorithm used to do th digestpublic static void main(java.lang.String[] args)
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |