如何将char缓冲区传递给Poco Context类构造函数?

时间:2017-07-12 06:20:54

标签: c++ ssl openssl poco-libraries

现在我将私钥文件路径传递给下面提到的Context Class。由于安全原因,我不会获得私钥的文件路径。 我使用它来与服务器进行SSL连接。

问题: 现在我将获得char缓冲区而不是私钥文件路径。如何将char缓冲区传递给Context类构造函数?

请帮帮我..

我说的是 Poco / Net / Context.h 这个课程。

价:

             Context(
                Usage usage,
                const std::string & privateKeyFile,
                const std::string & certificateFile,
                const std::string & caLocation,
                VerificationMode verificationMode = VERIFY_RELAXED,
                int verificationDepth = 9,
                bool loadDefaultCAs = false,
                const std::string & cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"
            );

如果我们使用usePrivateKey和useCertificate 然后如何定义上下文?

  Context::Ptr ptrContext = new Context(Context::TLSV1_2_CLIENT_USE, "", "", 
  "ca.crt", Context::VERIFY_STRICT, 9, true, 
  "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");

上面好吗? 如果我使用 usePrivateKey useCertificate 然后在上下文中,如果我将私钥和证书的filpath设为空,则ssl上下文仍然使用私钥和证书

0 个答案:

没有答案