Encryption 带有空密码短语的PGP在Mule中失败

Encryption 带有空密码短语的PGP在Mule中失败,encryption,mule,public-key-encryption,pgp,Encryption,Mule,Public Key Encryption,Pgp,我正在尝试使用PGP在Mule中创建加密解密服务。由于我创建的密钥对没有密码短语(因为这只是一个概念证明),所以我自然不会在配置中设置它。然而,Mule似乎正在强制执行一个非空的密码短语 我得到的错误是: ERROR 2015-02-23 14:19:31,509 [[mule-pgp].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy: *******

我正在尝试使用PGP在Mule中创建加密解密服务。由于我创建的密钥对没有密码短语(因为这只是一个概念证明),所以我自然不会在配置中设置它。然而,Mule似乎正在强制执行一个非空的密码短语

我得到的错误是:

    ERROR 2015-02-23 14:19:31,509 [[mule-pgp].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : Crypto Failure
Code                  : MULE_ERROR-111
--------------------------------------------------------------------------------
Exception stack is:
1. The password should not be null (java.lang.IllegalArgumentException)
  org.apache.commons.lang.Validate:203 (null)
2. Crypto Failure (org.mule.api.security.CryptoFailureException)
  org.mule.module.pgp.KeyBasedEncryptionStrategy:75 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/CryptoFailureException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalArgumentException: The password should not be null
    at org.apache.commons.lang.Validate.notNull(Validate.java:203)
    at org.mule.module.pgp.DecryptStreamTransformer.<init>(DecryptStreamTransformer.java:56)
    at org.mule.module.pgp.KeyBasedEncryptionStrategy.decrypt(KeyBasedEncryptionStrategy.java:69)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
错误2015-02-23 14:19:31509[[mule pgp].HTTP\u Listener\u Configuration.worker.01]org.mule.exception.defaultMessaginExceptionStrategy:
********************************************************************************
消息:加密失败
代码:MULE_错误-111
--------------------------------------------------------------------------------
异常堆栈是:
1.密码不应为null(java.lang.IllegalArgumentException)
org.apache.commons.lang.Validate:203(空)
2.加密失败(org.mule.api.security.CryptoFailureException)
org.mule.module.pgp.KeyBasedEncryptionStrategy:75(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/CryptoFailureException.html)
--------------------------------------------------------------------------------
根异常堆栈跟踪:
java.lang.IllegalArgumentException:密码不应为空
位于org.apache.commons.lang.Validate.notNull(Validate.java:203)
位于org.mule.module.pgp.DecryptStreamTransformer。(DecryptStreamTransformer.java:56)
在org.mule.module.pgp.KeyBasedEncryptionStrategy.decrypt上(KeyBasedEncryptionStrategy.java:69)
+3个以上(为所有内容设置调试级别日志或“-Dmule.verbose.exceptions=true”)
********************************************************************************
有没有办法绕过这个问题?我尝试为密码短语设置一个空格,但没有雪茄。

显示了一系列无法绕过的验证:

Validate.notNull(toBeDecrypted, "The toBeDecrypted should not be null");
Validate.notNull(publicKey, "The publicKey should not be null");
Validate.notNull(secretKey, "The secretKey should not be null");
Validate.notNull(password, "The password should not be null");
Validate.notNull(provider, "The security provider can't be null");

所以我能想到的解决问题的唯一办法就是实际使用密码短语。

明白了。虽然有点令人不快,我理解事物的安全性方面,但我不太喜欢一个强迫我使用某个特性的工具。这就像说,无论您的环境如何,您只能使用2048位或更高的密钥。