net.named_data.jndn.encrypt
public class Producer extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Producer.OnEncryptedKeys |
| Constructor and Description |
|---|
Producer(Name prefix,
Name dataType,
Face face,
KeyChain keyChain,
ProducerDb database)
Create a Producer to use the given ProducerDb, Face and other values.
|
Producer(Name prefix,
Name dataType,
Face face,
KeyChain keyChain,
ProducerDb database,
int repeatAttempts)
Create a Producer to use the given ProducerDb, Face and other values.
|
| Modifier and Type | Method and Description |
|---|---|
Name |
createContentKey(double timeSlot,
Producer.OnEncryptedKeys onEncryptedKeys)
Create the content key.
|
void |
produce(Data data,
double timeSlot,
Blob content)
Encrypt the given content with the content key that covers timeSlot, and
update the data packet with the encrypted content and an appropriate data
name.
|
public Producer(Name prefix, Name dataType, Face face, KeyChain keyChain, ProducerDb database, int repeatAttempts)
prefix - The producer name prefix. This makes a copy of the Name.dataType - The dataType portion of the producer name. This makes a
copy of the Name.face - The face used to retrieve keys.keyChain - The keyChain used to sign data packets.database - The ProducerDb database for storing keys.repeatAttempts - The maximum retry for retrieving keys.public Producer(Name prefix, Name dataType, Face face, KeyChain keyChain, ProducerDb database)
prefix - The producer name prefix.dataType - The dataType portion of the producer name.face - The face used to retrieve keys.keyChain - The keyChain used to sign data packets.database - The ProducerDb database for storing keys.public final Name createContentKey(double timeSlot, Producer.OnEncryptedKeys onEncryptedKeys) throws ProducerDb.Error, IOException, SecurityException
timeSlot - The time slot as milliseconds since Jan 1, 1970 UTC.onEncryptedKeys - If this creates a content key, then this calls
onEncryptedKeys.onEncryptedKeys(keys) where keys is a list of encrypted
content key Data packets. If onEncryptedKeys is null, this does not use it.ProducerDb.ErrorIOExceptionSecurityExceptionpublic final void produce(Data data, double timeSlot, Blob content) throws ProducerDb.Error, IOException, SecurityException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, InvalidKeySpecException
data - An empty Data object which is updated.timeSlot - The time slot as milliseconds since Jan 1, 1970 UTC.content - The content to encrypt.ProducerDb.ErrorIOExceptionSecurityExceptionNoSuchAlgorithmExceptionNoSuchPaddingExceptionInvalidKeyExceptionIllegalBlockSizeExceptionBadPaddingExceptionInvalidAlgorithmParameterExceptionInvalidKeySpecExceptionCopyright © 2016. All rights reserved.