EncryptorV2 Class¶
EncryptorV2 encrypts the requested content for name-based access control (NAC) using security v2. For the meaning of “KEK”, etc. see: https://github.com/named-data/name-based-access-control/blob/new/docs/spec.rst
[C++]: | #include <ndn-cpp/encrypt/encryptor-v2.hpp> Namespace:
ndn |
---|---|
[Python]: | Module: pyndn.encrypt |
[Java]: | Package: net.named_data.jndn.encrypt |
EncryptorV2 Constructor¶
Create an EncryptorV2 with the given parameters. This uses the face to register to receive Interests for the prefix {ckPrefix}/CK.
[C++]: | EncryptorV2(
const Name& accessPrefix,
const Name& ckPrefix,
const SigningInfo& ckDataSigningInfo,
const EncryptError::OnError& onError,
Validator* validator,
KeyChain* keyChain,
Face* face
);
|
---|---|
[Python]: | def __init__(self
accessPrefix, # Name
ckPrefix, # Name
ckDataSigningInfo, # SigningInfo
onError, # function object
validator, # Validator
keyChain, # KeyChain
face # Face
)
|
[JavaScript]: | var EncryptorV2 = function EncryptorV2(
accessPrefix, // Name
ckPrefix, // Name
ckDataSigningInfo, // SigningInfo
onError, // function
validator, // Validator
keyChain, // KeyChain
face // Face
)
|
[Java]: | public EncryptorV2(
Name accessPrefix,
Name ckPrefix,
SigningInfo ckDataSigningInfo,
OnError onError,
Validator validator,
KeyChain keyChain,
Face face
)
|
Parameters: |
|
EncryptorV2.encrypt Method¶
Encrypt the plainData using the existing Content Key (CK) and return a new EncryptedContent.
[C++]: | ptr_lib::shared_ptr<EncryptedContent> encrypt(
const uint8_t* plainData,
size_t plainDataLength
);
ptr_lib::shared_ptr<EncryptedContent> encrypt(
const Blob& plainData
);
|
---|---|
[Python]: | # Returns EncryptedContent
def encrypt(self,
plainData, # Blob
)
|
[JavaScript]: | // Returns EncryptedContent
EncryptorV2.prototype.encrypt = function(
plainData, // Blob
)
|
[Java]: | public final EncryptedContent encrypt(
byte[] plainData
)
|
Parameters: |
|
Returns: | The new EncryptedContent. |
EncryptorV2.regenerateCk Method¶
Create a new Content Key (CK) and publish the corresponding CK Data packet. This uses the onError given to the constructor to report errors.
[C++]: | void regenerateCk();
|
---|---|
[Python]: | def regenerateCk(self)
|
[JavaScript]: | EncryptorV2.prototype.regenerateCk = function()
|
[Java]: | public final void regenerateCk()
|