23 #ifndef NDN_SAFE_BAG_HPP
24 #define NDN_SAFE_BAG_HPP
26 #include "security-common.hpp"
27 #include "v2/certificate-v2.hpp"
46 certificate_ = ptr_lib::make_shared<Data>(certificate);
47 privateKeyBag_ = privateKeyBag;
74 const uint8_t* password = 0,
size_t passwordLength = 0,
75 DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256,
78 certificate_ = makeSelfSignedCertificate
79 (keyName, privateKeyBag, publicKeyEncoding, password, passwordLength,
80 digestAlgorithm, wireFormat);
81 privateKeyBag_ = privateKeyBag;
89 const ptr_lib::shared_ptr<Data>&
getCertificate()
const {
return certificate_; }
100 static ptr_lib::shared_ptr<CertificateV2>
101 makeSelfSignedCertificate
102 (
const Name& keyName,
Blob privateKeyBag,
Blob publicKeyEncoding,
103 const uint8_t* password,
size_t passwordLength,
104 DigestAlgorithm digestAlgorithm,
WireFormat& wireFormat);
106 ptr_lib::shared_ptr<Data> certificate_;
const Blob & getPrivateKeyBag() const
Get the encoded private key.
Definition: safe-bag.hpp:97
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
A SafeBag represents a container for sensitive related information such as a certificate and private ...
Definition: safe-bag.hpp:35
const ptr_lib::shared_ptr< Data > & getCertificate() const
Get the certificate data packet.
Definition: safe-bag.hpp:89
SafeBag(const Data &certificate, Blob privateKeyBag)
Create a SafeBag with the given certificate and private key.
Definition: safe-bag.hpp:44