#include <tnlAsymmetricKey.h>
Inheritance diagram for TNL::AsymmetricKey:
Public Member Functions | |
AsymmetricKey (U8 *dataPtr, U32 bufferSize) | |
Constructs an AsymmetricKey from the specified data pointer. | |
AsymmetricKey (const ByteBuffer &theBuffer) | |
Constructs an AsymmetricKey from a ByteBuffer. | |
AsymmetricKey (BitStream *theStream) | |
Constructs an AsymmetricKey by reading it from a BitStream. | |
AsymmetricKey (U32 keySize) | |
Generates a new asymmetric key of keySize bytes. | |
~AsymmetricKey () | |
Destructor for the AsymmetricKey. | |
ByteBufferPtr | getPublicKey () |
Returns a ByteBuffer containing an encoding of the public key. | |
ByteBufferPtr | getPrivateKey () |
Returns a ByteBuffer containing an encoding of the private key. | |
bool | hasPrivateKey () |
Returns true if this AsymmetricKey is a key pair. | |
bool | isValid () |
Returns true if this is a valid key. | |
ByteBufferPtr | computeSharedSecretKey (AsymmetricKey *publicKey) |
Compute a key we can share with the specified AsymmetricKey for a symmetric crypto. | |
U32 | getKeySize () |
Returns the strength of the AsymmetricKey in byte size. | |
ByteBufferPtr | hashAndSign (const ByteBuffer &theByteBuffer) |
Constructs a digital signature for the specified buffer of bits. | |
bool | verifySignature (const ByteBuffer &theByteBuffer, const ByteBuffer &theSignature) |
Returns true if the private key associated with this AsymmetricKey signed theByteBuffer with theSignature. | |
Private Types | |
enum | KeyType { KeyTypePrivate, KeyTypePublic } |
Enum used to indicate the portion of the key we are working with. More... | |
Private Member Functions | |
void | load (const ByteBuffer &theBuffer) |
Load keypair from a buffer. | |
Private Attributes | |
void * | mKeyData |
Raw key data. | |
U32 | mKeySize |
Size of the key at construct time. | |
bool | mHasPrivateKey |
Do we have the private key for this? | |
ByteBufferPtr | mPublicKey |
Buffer containing the public half of this keypair. | |
ByteBufferPtr | mPrivateKey |
Buffer containing the private half of this keypair. | |
bool | mIsValid |
|
Enum used to indicate the portion of the key we are working with.
|
|
Constructs an AsymmetricKey from the specified data pointer.
|
|
Constructs an AsymmetricKey from a ByteBuffer.
|
|
Constructs an AsymmetricKey by reading it from a BitStream.
|
|
Generates a new asymmetric key of keySize bytes.
|
|
Destructor for the AsymmetricKey.
|
|
Load keypair from a buffer.
|
|
Returns a ByteBuffer containing an encoding of the public key.
|
|
Returns a ByteBuffer containing an encoding of the private key.
|
|
Returns true if this AsymmetricKey is a key pair.
|
|
Returns true if this is a valid key.
|
|
Compute a key we can share with the specified AsymmetricKey for a symmetric crypto.
|
|
Returns the strength of the AsymmetricKey in byte size.
|
|
Constructs a digital signature for the specified buffer of bits. This method only works for private keys. A public key only Asymmetric key will generate a signature of 0 bytes in length. |
|
Returns true if the private key associated with this AsymmetricKey signed theByteBuffer with theSignature.
|
|
Raw key data. The specific format of this buffer varies by cryptosystem, so look at the subclass to see how it's laid out. In general this is an opaque buffer. |
|
Size of the key at construct time.
|
|
Do we have the private key for this? We may only have access to the public key (for instance, when validating a message signed by someone else). |
|
Buffer containing the public half of this keypair.
|
|
Buffer containing the private half of this keypair.
|
|
|