com.trolltech.qt.network
Class QSslKey

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.network.QSslKey
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QSslKey
extends QtJambiObject
implements java.lang.Cloneable

The QSslKey class provides an interface for private and public keys. QSslKey provides a simple API for managing keys.

See also:
QSslSocket, QSslCertificate, and QSslCipher.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QSslKey()
          Constructs a null key.
QSslKey(QByteArray encoded, QSsl.KeyAlgorithm algorithm)
          Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format.
QSslKey(QByteArray encoded, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format)
          Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format.
QSslKey(QByteArray encoded, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format, QSsl.KeyType type)
          Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format.
QSslKey(QByteArray encoded, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format, QSsl.KeyType type, QByteArray passPhrase)
          Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format.
QSslKey(QIODevice device, QSsl.KeyAlgorithm algorithm)
          Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format.
QSslKey(QIODevice device, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format)
          Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format.
QSslKey(QIODevice device, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format, QSsl.KeyType type)
          Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format.
QSslKey(QIODevice device, QSsl.KeyAlgorithm algorithm, QSsl.EncodingFormat format, QSsl.KeyType type, QByteArray passPhrase)
          Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format.
QSslKey(QSslKey other)
          Constructs an identical copy of other.
 
Method Summary
 QSsl.KeyAlgorithm algorithm()
          Returns the key algorithm.
 void clear()
          Clears the contents of this key, making it a null key.
 QSslKey clone()
          This method is reimplemented for internal reasons
 long handle()
          Returns a pointer to the native key handle, if it is available; otherwise a null pointer is returned.
 boolean isNull()
          Returns true if this is a null key; otherwise false.
 int length()
          Returns the length of the key in bits, or -1 if the key is null.
 QByteArray toDer()
          Returns the key in DER encoding.
 QByteArray toDer(QByteArray passPhrase)
          Returns the key in DER encoding.
 QByteArray toPem()
          Returns the key in PEM encoding.
 QByteArray toPem(QByteArray passPhrase)
          Returns the key in PEM encoding.
 java.lang.String toString()
          Returns a string representation of the this QSslKey.
 QSsl.KeyType type()
          Returns the type of the key (i.e., PublicKey or PrivateKey).
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QSslKey

public QSslKey()
Constructs a null key.

See also:
isNull().


QSslKey

public QSslKey(QIODevice device,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format,
               QSsl.KeyType type)
Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if device provided a valid key.


QSslKey

public QSslKey(QIODevice device,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format)
Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if device provided a valid key.


QSslKey

public QSslKey(QIODevice device,
               QSsl.KeyAlgorithm algorithm)
Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if device provided a valid key.


QSslKey

public QSslKey(QIODevice device,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format,
               QSsl.KeyType type,
               QByteArray passPhrase)
Constructs a QSslKey by reading and decoding data from a device using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if device provided a valid key.


QSslKey

public QSslKey(QByteArray encoded,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format,
               QSsl.KeyType type)
Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if encoded contained a valid key.


QSslKey

public QSslKey(QByteArray encoded,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format)
Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if encoded contained a valid key.


QSslKey

public QSslKey(QByteArray encoded,
               QSsl.KeyAlgorithm algorithm)
Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if encoded contained a valid key.


QSslKey

public QSslKey(QByteArray encoded,
               QSsl.KeyAlgorithm algorithm,
               QSsl.EncodingFormat format,
               QSsl.KeyType type,
               QByteArray passPhrase)
Constructs a QSslKey by decoding the string in the byte array encoded using a specified algorithm and encoding format. If the encoded key is encrypted, passPhrase is used to decrypt it. type specifies whether the key is public or private.

After construction, use isNull() to check if encoded contained a valid key.


QSslKey

public QSslKey(QSslKey other)
Constructs an identical copy of other.

Method Detail

algorithm

public final QSsl.KeyAlgorithm algorithm()
Returns the key algorithm.


clear

public final void clear()
Clears the contents of this key, making it a null key.

See also:
isNull().


handle

public final long handle()
Returns a pointer to the native key handle, if it is available; otherwise a null pointer is returned.

You can use this handle together with the native API to access extended information about the key.

Warning: Use of this function has a high probability of being non-portable, and its return value may vary across platforms, and between minor Qt releases.


isNull

public final boolean isNull()
Returns true if this is a null key; otherwise false.

See also:
clear().


length

public final int length()
Returns the length of the key in bits, or -1 if the key is null.


toDer

public final QByteArray toDer()
Returns the key in DER encoding. The result is encrypted with passPhrase if the key is a private key and passPhrase is non-empty.


toDer

public final QByteArray toDer(QByteArray passPhrase)
Returns the key in DER encoding. The result is encrypted with passPhrase if the key is a private key and passPhrase is non-empty.


toPem

public final QByteArray toPem()
Returns the key in PEM encoding. The result is encrypted with passPhrase if the key is a private key and passPhrase is non-empty.


toPem

public final QByteArray toPem(QByteArray passPhrase)
Returns the key in PEM encoding. The result is encrypted with passPhrase if the key is a private key and passPhrase is non-empty.


type

public final QSsl.KeyType type()
Returns the type of the key (i.e., PublicKey or PrivateKey).


toString

public java.lang.String toString()
Returns a string representation of the this QSslKey.

Overrides:
toString in class java.lang.Object

clone

public QSslKey clone()
This method is reimplemented for internal reasons

Overrides:
clone in class java.lang.Object