Actions
Task #3014
closedCreate key encryption helper
Start date:
07/05/2015
Due date:
% Done:
100%
Estimated time:
Description
We should create a high level abstraction Encryptor, which prepare raw data into a encrypted Data packet. Its interface should look like this:
class Encryptor
{
/**
* @brief Encrypt @p payload using @p keybits with @p params
*
* This method should create an EncryptedContent and set it as the content of @p data.
* The @p keyName should be set as EncryptKeyLocator. This method will prepare all the other field
* in the EncryptedContent, such as EncryptAlgorithm, InitialVector, and EncryptedPayload.
*/
void
symEncrypt(Data& data, const Buffer& payload, const Name& encrypted keyName, const Buffer& keybits, const EncryptParams& params);
/**
* @brief Encrypt @p payload using @p publicKey with @p params
*
* This method will decide, according to the size of @p publicKey and @p payload, whether to use a nonce symmetric key.
*
* If @p payload is within the scope of @p publicKey, no nonce key is used. The method will create an EncryptedContent
* and set them as the content of @p data. The @p keyName should be set as EncryptKeyLocator. This method will prepare
* all the other field in the EncryptedContent, such as EncryptAlgorithm, InitialVector, and EncryptedPayload.
*
* If @p payload is larger than the maximum scope of @p public key, this method will generate a nonce key, use @p publicKey
* to encrypt the nonce key and use the nonce key (which is symmetric) to encrypt the payload. Thus this method will create
* two EncryptedContent TLVs (the first one for the nonce-key and the second one for payload), both of them will be put into
* the same data packet.
*/
void
asymEncrypt(Data& data, const Buffer& payload, const Name& encrypted keyName, const PublicKey& publicKey, const EncryptParams);
}
Updated by Yingdi Yu almost 10 years ago
- Blocked by Task #3013: Add InitialVector as an optional field in EncryptedContent added
Updated by Yingdi Yu almost 10 years ago
- Blocks Task #3015: Primary Group Manager added
Updated by Yingdi Yu almost 10 years ago
- Status changed from New to Code review
- % Done changed from 0 to 80
Updated by Yingdi Yu over 9 years ago
- Status changed from Code review to Closed
- % Done changed from 80 to 100
Actions