IcedTea-Web
NetX

net.sourceforge.jnlp.tools
Class KeyTool

java.lang.Object
  extended by net.sourceforge.jnlp.tools.KeyTool

public class KeyTool
extends java.lang.Object

This tool manages the user's trusted certificates


Constructor Summary
KeyTool()
           
 
Method Summary
 boolean checkCacertsForCertificate(java.security.cert.Certificate c)
          Checks if a given certificate is part of the user's cacerts keystore.
 boolean establishCertChain(java.security.cert.Certificate userCert, java.security.cert.Certificate certToVerify)
          Establishes a certificate chain (using trusted certificates in the keystore), starting with the user certificate and ending at a self-signed certificate found in the keystore.
 boolean importCert(java.security.cert.Certificate cert)
          Adds a trusted certificate to the user's keystore.
 boolean importCert(java.io.File file)
          Adds a trusted certificate to the user's keystore.
 boolean isTrusted(java.security.cert.Certificate cert)
          Returns true if the given certificate is trusted, false otherwise.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyTool

public KeyTool()
        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

importCert

public boolean importCert(java.io.File file)
                   throws java.lang.Exception
Adds a trusted certificate to the user's keystore.

Returns:
true if the add was successful, false otherwise.
Throws:
java.lang.Exception

importCert

public boolean importCert(java.security.cert.Certificate cert)
                   throws java.lang.Exception
Adds a trusted certificate to the user's keystore.

Returns:
true if the add was successful, false otherwise.
Throws:
java.lang.Exception

isTrusted

public boolean isTrusted(java.security.cert.Certificate cert)
                  throws java.lang.Exception
Returns true if the given certificate is trusted, false otherwise.

Throws:
java.lang.Exception

checkCacertsForCertificate

public boolean checkCacertsForCertificate(java.security.cert.Certificate c)
                                   throws java.lang.Exception
Checks if a given certificate is part of the user's cacerts keystore.

Parameters:
c - the certificate to check
Returns:
true if the certificate is in the user's cacerts and false otherwise
Throws:
java.lang.Exception

establishCertChain

public boolean establishCertChain(java.security.cert.Certificate userCert,
                                  java.security.cert.Certificate certToVerify)
                           throws java.lang.Exception
Establishes a certificate chain (using trusted certificates in the keystore), starting with the user certificate and ending at a self-signed certificate found in the keystore.

Parameters:
userCert - the user certificate of the alias
certToVerify - the single certificate provided in the reply
Throws:
java.lang.Exception

main

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

IcedTea-Web
NetX

Submit a bug or feature