//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import java.util.Calendar;
import java.util.ArrayList;

/**

 KDE X.509 Certificate
 This class represents an X.509 (SSL) certificate.
 Note: this object is VERY HEAVY TO COPY.  Please try to use reference
       or pointer whenever possible
		@author George Staikos <staikos@kde.org>

		@short KDE X.509 Certificate.
		@see KSSL

*/
public class KSSLCertificate implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;
	protected KSSLCertificate(Class dummy){}

	/**	
		 A CA certificate can be validated as Irrelevant when it was
		 not used to sign any other relevant certificate.
		         		@short    A CA certificate can be validated as Irrelevant when it was  not used to sign any other relevant certificate.
	*/
	public static final int Unknown = 0;
	public static final int Ok = 1;
	public static final int NoCARoot = 2;
	public static final int InvalidPurpose = 3;
	public static final int PathLengthExceeded = 4;
	public static final int InvalidCA = 5;
	public static final int Expired = 6;
	public static final int SelfSigned = 7;
	public static final int ErrorReadingRoot = 8;
	public static final int NoSSL = 9;
	public static final int Revoked = 10;
	public static final int Untrusted = 11;
	public static final int SignatureFailed = 12;
	public static final int Rejected = 13;
	public static final int PrivateKeyFailed = 14;
	public static final int InvalidHost = 15;
	public static final int Irrelevant = 16;
	public static final int SelfSignedChain = 17;

	public static final int None = 0;
	public static final int SSLServer = 1;
	public static final int SSLClient = 2;
	public static final int SMIMESign = 3;
	public static final int SMIMEEncrypt = 4;
	public static final int Any = 5;

	/**	
		  Convert this certificate to a string.
				@return the certificate in base64 format
	 
		@short     Convert this certificate to a string.
	*/
	public native String toString();
	/**	
		  Get the subject of the certificate (X.509 map).
				@return the subject
	 
		@short     Get the subject of the certificate (X.
	*/
	public native String getSubject();
	/**	
		  Get the issuer of the certificate (X.509 map).
				@return the issuer
	 
		@short     Get the issuer of the certificate (X.
	*/
	public native String getIssuer();
	/**	
		  Get the date that the certificate becomes valid on.
				@return the date as a string, localised
	 
		@short     Get the date that the certificate becomes valid on.
	*/
	public native String getNotBefore();
	/**	
		  Get the date that the certificate is valid until.
				@return the date as a string, localised
	 
		@short     Get the date that the certificate is valid until.
	*/
	public native String getNotAfter();
	/**	
		  Get the date that the certificate becomes valid on.
				@return the date
	 
		@short     Get the date that the certificate becomes valid on.
	*/
	public native Calendar getQDTNotBefore();
	/**	
		  Get the date that the certificate is valid until.
				@return the date
	 
		@short     Get the date that the certificate is valid until.
	*/
	public native Calendar getQDTNotAfter();
	/**	
		  Convert the certificate to DER (ASN.1) format.
				@return the binary data of the DER encoding
	 
		@short     Convert the certificate to DER (ASN.
	*/
	public native byte[] toDer();
	/**	
		  Convert the certificate to PEM (base64) format.
				@return the binary data of the PEM encoding
	 
		@short     Convert the certificate to PEM (base64) format.
	*/
	public native byte[] toPem();
	/**	
		  Convert the certificate to Netscape format.
				@return the binary data of the Netscape encoding
	 
		@short     Convert the certificate to Netscape format.
	*/
	public native byte[] toNetscape();
	/**	
		  Convert the certificate to OpenSSL plain text format.
				@return the OpenSSL text encoding
	 
		@short     Convert the certificate to OpenSSL plain text format.
	*/
	public native String toText();
	/**	
		  Get the serial number of the certificate.
				@return the serial number as a string
	 
		@short     Get the serial number of the certificate.
	*/
	public native String getSerialNumber();
	/**	
		  Get the key type (RSA, DSA, etc).
				@return the key type as a string
	 
		@short     Get the key type (RSA, DSA, etc).
	*/
	public native String getKeyType();
	/**	
		  Get the public key.
				@return the public key as a hexidecimal string
	 
		@short     Get the public key.
	*/
	public native String getPublicKeyText();
	/**	
		  Get the MD5 digest of the certificate.
		  Result is padded with : to separate bytes - it's a text version!
				@return the MD5 digest in a hexidecimal string
	 
		@short     Get the MD5 digest of the certificate.
	*/
	public native String getMD5DigestText();
	/**	
		  Get the MD5 digest of the certificate.
				@return the MD5 digest in a hexidecimal string
	 
		@short     Get the MD5 digest of the certificate.
	*/
	public native String getMD5Digest();
	/**	
		  Get the signature.
				@return the signature in text format
	 
		@short     Get the signature.
	*/
	public native String getSignatureText();
	/**	
		  Check if this is a valid certificate.  Will use cached data.
				@return true if it is valid
	 
		@short     Check if this is a valid certificate.
	*/
	public native boolean isValid();
	/**	
		  Check if this is a valid certificate.  Will use cached data.
			@param p the purpose to validate for
				@return true if it is valid
	 
		@short     Check if this is a valid certificate.
	*/
	public native boolean isValid(int p);
	/**	
		  The alternate subject name.
				@return string list with subjectAltName
	 
		@short     The alternate subject name.
	*/
	public native ArrayList subjAltNames();
	/**	
		  Check if this is a valid certificate.  Will use cached data.
				@return the result of the validation
	 
		@short     Check if this is a valid certificate.
	*/
	public native int validate();
	/**	
		  Check if this is a valid certificate.  Will use cached data.
			@param p the purpose to validate for
				@return the result of the validation
	 
		@short     Check if this is a valid certificate.
	*/
	public native int validate(int p);
	/**	
		  Check if this is a valid certificate.  Will use cached data.
			@param p the purpose to validate for
				@return all problems encountered during validation
	 
		@short     Check if this is a valid certificate.
	*/
	// KSSLCertificate::KSSLValidationList validateVerbose(KSSLCertificate::KSSLPurpose arg1); >>>> NOT CONVERTED
	/**	
		  Check if the certificate ca is a proper CA for this
		  certificate.
			@param p the purpose to validate for
			@param ca the certificate to check
				@return all problems encountered during validation
	 
		@short     Check if the certificate ca is a proper CA for this   certificate.
	*/
	// KSSLCertificate::KSSLValidationList validateVerbose(KSSLCertificate::KSSLPurpose arg1,KSSLCertificate* arg2); >>>> NOT CONVERTED
	/**	
		  Check if this is a valid certificate.  Will NOT use cached data.
				@return the result of the validation
	 
		@short     Check if this is a valid certificate.
	*/
	public native int revalidate();
	/**	
		  Check if this is a valid certificate.  Will NOT use cached data.
			@param p the purpose to validate for
				@return the result of the validation
	 
		@short     Check if this is a valid certificate.
	*/
	public native int revalidate(int p);
	/**	
		  Get a reference to the certificate chain.
				@return reference to the chain
	 
		@short     Get a reference to the certificate chain.
	*/
	public native KSSLCertChain chain();
	/**	
		  Explicitly make a copy of this certificate.
				@return a copy of the certificate
	 
		@short     Explicitly make a copy of this certificate.
	*/
	public native KSSLCertificate replicate();
	/**	
		  Copy constructor.  Beware, this is very expensive.
			@param x the object to copy from
			 		@short     Copy constructor.
	*/
	public KSSLCertificate(KSSLCertificate x) {
		newKSSLCertificate(x);
	}
	private native void newKSSLCertificate(KSSLCertificate x);
	/**	
		  Re-set the certificate from a base64 string.
			@param cert the certificate to set to
				@return true on success
	 
		@short     Re-set the certificate from a base64 string.
	*/
	public native boolean setCert(StringBuffer cert);
	/**	
		  Access the X.509v3 parameters.
				@return reference to the extension object

		@short     Access the X.
		@see KSSLX509V3
	*/
	public native KSSLX509V3 x509V3Extensions();
	/**	
		  Check if this is a signer certificate.
				@return true if this is a signer certificate
	 
		@short     Check if this is a signer certificate.
	*/
	public native boolean isSigner();
	/**	
		  FIXME: document
			 		@short     FIXME: document
	*/
	public native void getEmails(String[] to);
	/**	
		 KDEKey is a concatenation "Subject (MD5)", mostly needed for SMIME.
		 The result of getKDEKey might change and should not be used for
		 persistant storage.
			 		@short    KDEKey is a concatenation "Subject (MD5)", mostly needed for SMIME.
	*/
	public native String getKDEKey();
	/**	
		  Create an X.509 certificate from a base64 encoded string.
			@param cert the certificate in base64 form
				@return the X.509 certificate, or NULL
	 
		@short     Create an X.
	*/
	public static native KSSLCertificate fromString(String cert);
	/**	
		  Create an X.509 certificate from the internal representation.
		  This one duplicates the X509 object for itself.
			@param x5 the OpenSSL representation of the certificate
				 		@return the X.509 certificate, or NULL

		@short     Create an X.
	*/
	// KSSLCertificate* fromX509(X509* arg1); >>>> NOT CONVERTED
	/**	
		  Obtain the localized message that corresponds to a validation result.
			@param x the code to look up
				@return the message text corresponding to the validation code
	 
		@short     Obtain the localized message that corresponds to a validation result.
	*/
	public static native String verifyText(int x);
	/**	
		 Aegypten semantics force us to search by MD5Digest only.
			 		@short    Aegypten semantics force us to search by MD5Digest only.
	*/
	public static native String getMD5DigestFromKDEKey(String k);
	public KSSLCertificate() {
		newKSSLCertificate();
	}
	private native void newKSSLCertificate();
	// void setCert(X509* arg1); >>>> NOT CONVERTED
	// void setChain(void* arg1); >>>> NOT CONVERTED
	// X509* getCert(); >>>> NOT CONVERTED
	protected native int processError(int ec);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}
