A SafeBag represents a container for sensitive related information such as a certificate and private key.
More...
#include <safe-bag.hpp>
A SafeBag represents a container for sensitive related information such as a certificate and private key.
| ndn::SafeBag::SafeBag |
( |
const Data & |
certificate, |
|
|
Blob |
privateKeyBag |
|
) |
| |
|
inline |
Create a SafeBag with the given certificate and private key.
- Parameters
-
| certificate | The certificate data packet. This copies the object. |
| privateKeyBag | The encoded private key. If encrypted, this is a PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted PKCS #8 PrivateKeyInfo. |
Create a SafeBag with given private key and a new self-signed certificate for the given public key.
- Parameters
-
| keyName | The name of the public key. The certificate name will be {keyName}/self/{version} where the version is based on the current time. This copies the Name. |
| privateKeyBag | The encoded private key. If encrypted, this is a PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted PKCS #8 PrivateKeyInfo. |
| publicKeyEncoding | The encoded public key for the certificate. |
| password | (optional) The password for decrypting the private key in order to sign the self-signed certificate. If the password is supplied, use it to decrypt the PKCS #8 EncryptedPrivateKeyInfo. If the password is omitted or null, privateKeyBag is an unencrypted PKCS #8 PrivateKeyInfo. |
| passwordLength | (optional) The length of the password. If password is omitted ornull, this is ignored. |
| digestAlgorithm | (optional) The digest algorithm for signing the self-signed certificate. If omitted, use DIGEST_ALGORITHM_SHA256 . |
| wireFormat | (optional) A WireFormat object used to encode the self-signed certificate in order to sign it. If omitted, use WireFormat getDefaultWireFormat(). |
| const ptr_lib::shared_ptr<Data>& ndn::SafeBag::getCertificate |
( |
| ) |
const |
|
inline |
Get the certificate data packet.
- Returns
- The certificate as a Data packet. If you need to process it as a certificate object then you must create a new CertificateV2(data).
| const Blob& ndn::SafeBag::getPrivateKeyBag |
( |
| ) |
const |
|
inline |
Get the encoded private key.
- Returns
- The encoded private key. If encrypted, this is a PKCS #8 EncryptedPrivateKeyInfo. If not encrypted, this is an unencrypted PKCS #8 PrivateKeyInfo.
The documentation for this class was generated from the following files:
- include/ndn-cpp/security/safe-bag.hpp
- src/security/safe-bag.cpp