wt.intersvrcom
Class URLAuthenticator

java.lang.Object
  extended bywt.intersvrcom.URLAuthenticator
All Implemented Interfaces:
Externalizable, Serializable

public class URLAuthenticator
extends Object
implements Externalizable



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static boolean AUTH_REQUIRED
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static int GRACE_PERIOD
           
private static boolean HTTP_THRU_PROXY
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String proxyHost
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Constructor Summary
URLAuthenticator()
           
 
Method Summary
static boolean checkAuthentication(HTTPRequest request)
          

Supported API: false
private static boolean checkProxyThruHttp(String localUrl)
           
private static String decodeUTF8(String s)
           
private static String encodePathAndQueryString(String url)
           
private static PublicKey findKey(String siteURL)
           
private static PublicKey findKeyFromDB(String siteUrl)
           
private static PublicKey findKeyFromDisk(String siteURL)
           
static void main(String[] args)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(URLAuthenticator thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
static String sign(String url)
          If the URLConnection is initialized by Windchill client applications or browsers, use this method in order to force client host to be included in the digital signature..
static String sign(String url, boolean internal)
          Set "internal" to true if the http connection is issued by Windchill server ("internal" only), otherwise if the connection is initialized by Windchill client applications or browsers, this value should be set to false, in order to force client host to be included in the digital signature.
static String sign(String url, boolean internal, Site site, SiteSecurity security)
           
static String sign(String url, Site site)
          Sign the request with the site's private key

Supported API: false
static String sign(String url, SiteSecurity siteSecurity, Site site)
           
private static String sign(String url, Site site, SiteSecurity siteSecurity)
           
static String sign(String url, String localSiteURL, PrivateKey key)
          Sign the url with the given key

Supported API: false
private static String sign0(String url, PrivateKey key)
           
static boolean verify(String url, byte[] sign, PublicKey key)
          Verify the URL with the given public key.
static boolean verify(String url, byte[] sign, Site site)
          Verify the URL with the site's public key.
private static boolean verify0(String url, byte[] sign, PublicKey key)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

GRACE_PERIOD

private static int GRACE_PERIOD

HTTP_THRU_PROXY

private static boolean HTTP_THRU_PROXY

proxyHost

private static String proxyHost

AUTH_REQUIRED

private static boolean AUTH_REQUIRED
Constructor Detail

URLAuthenticator

public URLAuthenticator()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(URLAuthenticator thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

sign

public static String sign(String url)
                   throws WTException
If the URLConnection is initialized by Windchill client applications or browsers, use this method in order to force client host to be included in the digital signature.. This is equivalent to call sign (url, false). If the URLConnection is initialized by Windchill server, call sign (url, true).

Supported API: true

Parameters:
url -
Returns:
String
Throws:
WTException

sign

public static String sign(String url,
                          boolean internal)
                   throws WTException
Set "internal" to true if the http connection is issued by Windchill server ("internal" only), otherwise if the connection is initialized by Windchill client applications or browsers, this value should be set to false, in order to force client host to be included in the digital signature.

Supported API: true

Parameters:
url -
internal -
Returns:
String
Throws:
WTException

sign

public static String sign(String url,
                          Site site)
                   throws WTException
Sign the request with the site's private key

Supported API: false

Parameters:
url -
site -
Returns:
String
Throws:
WTException

sign

public static String sign(String url,
                          String localSiteURL,
                          PrivateKey key)
                   throws WTException
Sign the url with the given key

Supported API: false

Parameters:
url -
localSiteURL -
key -
Returns:
String
Throws:
WTException

verify

public static boolean verify(String url,
                             byte[] sign,
                             Site site)
                      throws WTException
Verify the URL with the site's public key.

Supported API: false

Parameters:
url -
sign -
site -
Returns:
boolean
Throws:
WTException

verify

public static boolean verify(String url,
                             byte[] sign,
                             PublicKey key)
                      throws WTException
Verify the URL with the given public key.

Supported API: false

Parameters:
url -
sign -
key -
Returns:
boolean
Throws:
WTException

checkAuthentication

public static boolean checkAuthentication(HTTPRequest request)
                                   throws WTTransportException


Supported API: false

Parameters:
request -
Returns:
boolean
Throws:
WTTransportException

sign0

private static String sign0(String url,
                            PrivateKey key)
                     throws NoSuchAlgorithmException,
                            Exception
Throws:
NoSuchAlgorithmException
Exception

verify0

private static boolean verify0(String url,
                               byte[] sign,
                               PublicKey key)
                        throws NoSuchAlgorithmException,
                               Exception
Throws:
NoSuchAlgorithmException
Exception

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

findKey

private static PublicKey findKey(String siteURL)

findKeyFromDB

private static PublicKey findKeyFromDB(String siteUrl)

findKeyFromDisk

private static PublicKey findKeyFromDisk(String siteURL)

checkProxyThruHttp

private static boolean checkProxyThruHttp(String localUrl)

encodePathAndQueryString

private static String encodePathAndQueryString(String url)
                                        throws WTException
Throws:
WTException

decodeUTF8

private static String decodeUTF8(String s)

sign

public static String sign(String url,
                          SiteSecurity siteSecurity,
                          Site site)
                   throws WTException
Throws:
WTException

sign

public static String sign(String url,
                          boolean internal,
                          Site site,
                          SiteSecurity security)
                   throws WTException
Throws:
WTException

sign

private static String sign(String url,
                           Site site,
                           SiteSecurity siteSecurity)
                    throws WTException
Throws:
WTException