22 #ifndef NDN_RSA_PRIVATE_KEY_LITE_HPP
23 #define NDN_RSA_PRIVATE_KEY_LITE_HPP
25 #include "../util/blob-lite.hpp"
26 #include "../../c/errors.h"
27 #include "../../c/encrypt/algo/encrypt-params-types.h"
28 #include "../../c/security/rsa-private-key-types.h"
57 decode(
const uint8_t* privateKeyDer,
size_t privateKeyDerLength);
123 (
const uint8_t* data,
size_t dataLength, uint8_t* signature,
124 size_t& signatureLength)
const;
138 (
const BlobLite& data, uint8_t* signature,
size_t& signatureLength)
const
158 (
const uint8_t* encryptedData,
size_t encryptedDataLength,
159 ndn_EncryptAlgorithmType algorithmType, uint8_t* plainData,
160 size_t& plainDataLength);
176 (
const BlobLite& encryptedData, ndn_EncryptAlgorithmType algorithmType,
177 uint8_t* plainData,
size_t& plainDataLength)
180 (encryptedData.
buf(), encryptedData.
size(), algorithmType, plainData,
size_t size() const
Return size given to the constructor.
Definition: blob-lite.hpp:61
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
ndn_Error decode(const BlobLite &privateKeyDer)
Decode the DER-encoded PKCS #1 privateKeyDer and set this RsaPrivateKeyLite, allocating memory as nee...
Definition: rsa-private-key-lite.hpp:67
ndn_Error signWithSha256(const uint8_t *data, size_t dataLength, uint8_t *signature, size_t &signatureLength) const
Use this private key to sign the data using RsaWithSha256.
Definition: rsa-private-key-lite.cpp:64
ndn_Error decrypt(const uint8_t *encryptedData, size_t encryptedDataLength, ndn_EncryptAlgorithmType algorithmType, uint8_t *plainData, size_t &plainDataLength)
Use the private key to decrypt encryptedData according to the algorithmType.
Definition: rsa-private-key-lite.cpp:73
A struct ndn_RsaPrivateKey holds a decoded RSA private key for use in crypto operations.
Definition: rsa-private-key-types.h:34
ndn_Error encodePrivateKey(uint8_t *encoding, size_t &encodingLength) const
Encode the DER-encoded PKCS #1 private key.
Definition: rsa-private-key-lite.cpp:51
A BlobLite holds a pointer to an immutable pre-allocated buffer and its length This is like a JavaScr...
Definition: blob-lite.hpp:37
const uint8_t * buf() const
Return buf given to the constructor.
Definition: blob-lite.hpp:55
ndn_Error encodePublicKey(uint8_t *encoding, size_t &encodingLength) const
Encode the DER-encoded SubjectPublicKeyInfo.
Definition: rsa-private-key-lite.cpp:57
ndn_Error decode(const uint8_t *privateKeyDer, size_t privateKeyDerLength)
Decode the DER-encoded PKCS #1 privateKeyDer and set this RsaPrivateKeyLite, allocating memory as nee...
Definition: rsa-private-key-lite.cpp:39
ndn_Error generate(uint32_t keySize)
Generate a key pair and set this RsaPrivateKeyLite, allocating memory as needed.
Definition: rsa-private-key-lite.cpp:45
RsaPrivateKeyLite()
Create an RsaPrivateKeyLite with a null value.
Definition: rsa-private-key-lite.cpp:27
static RsaPrivateKeyLite & downCast(ndn_RsaPrivateKey &blob)
Downcast the reference to the ndn_RsaPrivateKey struct to a RsaPrivateKeyLite.
Definition: rsa-private-key-lite.hpp:190
An RsaPrivateKeyLite holds a decoded or generated RSA private key for use in crypto operations...
Definition: rsa-private-key-lite.hpp:36
~RsaPrivateKeyLite()
Finalize the RsaPrivateKeyLite, freeing memory if needed.
Definition: rsa-private-key-lite.cpp:32