org.kde.koala
Class KSSLPKCS12

java.lang.Object
  extended by org.kde.koala.KSSLPKCS12
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KSSLPKCS12
extends java.lang.Object
implements org.kde.qt.QtSupport

KDE PKCS#12 Certificate As of yet, this class is being defined. if you use it, let it be known that BC will break on you until this message is removed.

Author:
George Staikos
See Also:
KSSL, KSSLCertificate

Constructor Summary
  KSSLPKCS12()
           
protected KSSLPKCS12(java.lang.Class dummy)
           
 
Method Summary
 boolean changePassword(java.lang.String pold, java.lang.String pnew)
          Change the password of the PKCS#12 in memory.
 void dispose()
          Delete the wrapped C++ instance ahead of finalize()
protected  void finalize()
          Deletes the wrapped C++ instance
static KSSLPKCS12 fromString(java.lang.String base64)
           
static KSSLPKCS12 fromString(java.lang.String base64, java.lang.String password)
          Create a KSSLPKCS12 object from a Base64 in a String.
 KSSLCertificate getCertificate()
          Get the X.509 certificate.
 boolean isDisposed()
          Has the wrapped C++ instance been deleted?
 boolean isValid()
          Check if the X.509 and private key are valid.
 boolean isValid(int p)
          Check if the X.509 and private key are valid.
static KSSLPKCS12 loadCertFile(java.lang.String filename)
           
static KSSLPKCS12 loadCertFile(java.lang.String filename, java.lang.String password)
          Create a KSSLPKCS12 object by reading a PKCS#12 file.
 java.lang.String name()
          The name of this certificate.
protected  boolean parse(java.lang.String pass)
           
 int revalidate()
          Check the X.509 and private key to make sure they're valid.
 int revalidate(int p)
          Check the X.509 and private key to make sure they're valid.
 boolean toFile(java.lang.String filename)
          Write the PKCS#12 to a file in raw mode.
 java.lang.String toString()
          Convert to a Base64 string.
 int validate()
          Check the X.509 and private key to make sure they're valid.
 int validate(int p)
          Check the X.509 and private key to make sure they're valid.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KSSLPKCS12

protected KSSLPKCS12(java.lang.Class dummy)

KSSLPKCS12

public KSSLPKCS12()
Method Detail

name

public java.lang.String name()
The name of this certificate. This can be used to refer to the certificate instead of passing the object itself.

Returns:
the name of the certificate

toString

public java.lang.String toString()
Convert to a Base64 string.

Overrides:
toString in class java.lang.Object
Returns:
the certificate in base64 form

changePassword

public boolean changePassword(java.lang.String pold,
                              java.lang.String pnew)
Change the password of the PKCS#12 in memory.

Parameters:
pold - the old password
pnew - the new password
Returns:
true on success

getCertificate

public KSSLCertificate getCertificate()
Get the X.509 certificate.

Returns:
the X.509 certificate for the PKCS#12 object, or NULL

toFile

public boolean toFile(java.lang.String filename)
Write the PKCS#12 to a file in raw mode.

Parameters:
filename - the file to write to
Returns:
true on success

validate

public int validate()
Check the X.509 and private key to make sure they're valid.

Returns:
the result of the validation
See Also:
KSSLCertificate

validate

public int validate(int p)
Check the X.509 and private key to make sure they're valid.

Parameters:
p - the purpose to validate for
Returns:
the result of the validation
See Also:
KSSLCertificate

revalidate

public int revalidate()
Check the X.509 and private key to make sure they're valid. Ignore any cached validation result.

Returns:
the result of the validation
See Also:
KSSLCertificate

revalidate

public int revalidate(int p)
Check the X.509 and private key to make sure they're valid. Ignore any cached validation result.

Parameters:
p - the purpose to validate for
Returns:
the result of the validation
See Also:
KSSLCertificate

isValid

public boolean isValid()
Check if the X.509 and private key are valid.

Returns:
true if valid

isValid

public boolean isValid(int p)
Check if the X.509 and private key are valid.

Parameters:
p - the purpose to validate for
Returns:
true if valid

fromString

public static KSSLPKCS12 fromString(java.lang.String base64,
                                    java.lang.String password)
Create a KSSLPKCS12 object from a Base64 in a String.

Parameters:
base64 - the base64 encoded certificate
password - a password for the certificate if encrypted
Returns:
the PKCS#12 object, or NULL on failure.

fromString

public static KSSLPKCS12 fromString(java.lang.String base64)

loadCertFile

public static KSSLPKCS12 loadCertFile(java.lang.String filename,
                                      java.lang.String password)
Create a KSSLPKCS12 object by reading a PKCS#12 file.

Parameters:
filename - the filename of the certificate
password - a password for the certificate if encrypted
Returns:
the PKCS#12 object, or NULL on failure.

loadCertFile

public static KSSLPKCS12 loadCertFile(java.lang.String filename)

parse

protected boolean parse(java.lang.String pass)

finalize

protected void finalize()
                 throws java.lang.InternalError
Deletes the wrapped C++ instance

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.InternalError

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()


isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?