#include <ident.h>
Public Types | |
enum | Scheme { NoScheme = 0, MAC = 1, IP = 2, DSA160 = 10, RSA160 = 11 } |
Endpoint identifier scheme numbers. More... | |
Public Member Functions | |
Ident () | |
Create a null Ident. | |
Ident (const QByteArray &id) | |
Create an Ident with a given binary identifier. | |
Ident (const QByteArray &id, const QByteArray &key) | |
Create an Ident with a binary identifier and corresponding key. | |
QByteArray | id () const |
Get this identifier's short binary ID. | |
void | setID (const QByteArray &id) |
Set the Ident's short binary ID. | |
bool | isNull () |
Check for the distinguished "null identity". | |
Scheme | scheme () const |
Determine the scheme number this ID uses. | |
bool | haveKey () const |
Determine whether this identifier contains an associated key usable for signature verification. | |
bool | havePrivateKey () const |
Determine whether this identifier contains a private key usable for both signing and verification. | |
QByteArray | key (bool getPrivateKey=false) const |
Get this Ident's binary-encoded public or private key. | |
bool | setKey (const QByteArray &key) |
Set the public or private key associated with this Ident. | |
SecureHash * | newHash (QObject *parent=NULL) const |
Create a new SecureHash object suitable for hashing messages to be signed using this identity's private key. | |
QByteArray | hash (const void *data, int len) const |
Hash a block of data using this Ident scheme's hash function. | |
QByteArray | hash (const QByteArray &data) const |
Hash a QByteArray using this Ident scheme's hash function. | |
QByteArray | sign (const QByteArray &digest) const |
Sign a message. | |
bool | verify (const QByteArray &digest, const QByteArray &sig) const |
Verify a signature. | |
QByteArray | macAddress () |
Extract the IEEE MAC address in an identifier with the MAC scheme. | |
QHostAddress | ipAddress (quint16 *out_port=NULL) |
Extract the host address part of an identifier in the IP scheme. | |
quint16 | ipPort () |
Extract the port number part of an identifier in the IP scheme. | |
Static Public Member Functions | |
Ident | generate (Scheme sch=RSA160, int bits=0) |
Generate a new Ident with a unique private key, using reasonable default parameters. | |
Ident | fromMacAddress (const QByteArray &addr) |
Create an Ident representing a non-cryptographic IEEE MAC address. | |
Ident | fromIpAddress (const QHostAddress &addr, quint16 port=0) |
Create an Ident representing a non-cryptographic IP address. |
|
Endpoint identifier scheme numbers. The scheme number occupies the top 6 bits in any EID, making the EID's scheme easily recognizable via the first character in its Base64 representation.
|
|
Create an Ident with a given binary identifier.
|
|
Create an Ident with a binary identifier and corresponding key.
|
|
Create an Ident representing a non-cryptographic IP address. Non-cryptographic identifiers cannot have signing keys.
|
|
Create an Ident representing a non-cryptographic IEEE MAC address. Non-cryptographic identifiers cannot have signing keys.
|
|
Generate a new Ident with a unique private key, using reasonable default parameters.
|
|
Hash a QByteArray using this Ident scheme's hash function. This is just a convenience function based on newHash().
|
|
Hash a block of data using this Ident scheme's hash function. This is just a convenience function based on newHash().
|
|
Determine whether this identifier contains an associated key usable for signature verification.
|
|
Determine whether this identifier contains a private key usable for both signing and verification.
|
|
Get this identifier's short binary ID.
|
|
Extract the host address part of an identifier in the IP scheme.
|
|
Extract the port number part of an identifier in the IP scheme.
|
|
Check for the distinguished "null identity".
|
|
Get this Ident's binary-encoded public or private key.
|
|
Extract the IEEE MAC address in an identifier with the MAC scheme.
|
|
Create a new SecureHash object suitable for hashing messages to be signed using this identity's private key.
|
|
Determine the scheme number this ID uses.
|
|
Set the Ident's short binary ID. Clears any associated key information.
|
|
Set the public or private key associated with this Ident.
|
|
Sign a message. This Ident must contain a valid private key.
|
|
Verify a signature. This ident must contain a valid public key.
|