【问题标题】:PGP Encrypting / Decrypting with Apache Camel: Key not found in keyring使用 Apache Camel 进行 PGP 加密/解密:在密钥环中找不到密钥
【发布时间】:2019-03-26 15:35:27
【问题描述】:

我正在尝试使用 Apache Camel (XML DSL) 实现 PGP 加密/解密。

我使用 Kleoptra 创建了一个 OpenPGP 密钥集(并进行了测试以验证密钥可用于加密和解密)

现在,在我的骆驼上下文中,我有以下内容:

<dataFormats>
    <pgp id="encrypt" keyFileName="party2public.pgp" keyUserid="party2"/>
    <pgp id="decrypt" keyFileName="party2private.pgp"/>
</dataFormats>

<route id="encrypter">
    <from uri="file:ToEncrypt"/>
    <marshal ref="encrypt"/>
    <to uri="file:Encrypted"/>
</route>

<route id="decrypter">
    <from uri="file:ToDecrypt"/>
    <unmarshal ref="decrypt"/>
    <to uri="file:Decrypted"/>
</route>

加密文件时,它按预期工作,文件最终在 Encrypted 文件夹中加密。但是在尝试解密时,出现以下错误:

org.bouncycastle.openpgp.PGPException: PGP 消息使用在 Secret Keyring 中找不到的密钥加密。

知道为什么会这样吗?

【问题讨论】:

    标签: encryption apache-camel pgp


    【解决方案1】:

    我认为您只需要在您的 pgp 解密 bean 上添加密码 =“”。

    顺便说一句,我正在修复上游:https://issues.apache.org/jira/browse/CAMEL-12897

    【讨论】:

      猜你喜欢
      • 2012-05-06
      • 1970-01-01
      • 2019-12-25
      • 2021-09-04
      • 1970-01-01
      • 2010-10-10
      • 2017-11-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多