亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用 OpenSAML 2 和 Java 測試/調試解密加密斷言?

如何使用 OpenSAML 2 和 Java 測試/調試解密加密斷言?

慕田峪9158850 2022-06-15 14:39:41
我正在嘗試與 OpenSAML2 (2.6.6) 一起編寫 Java 應用程序來解密加密的斷言,但我得到:[main] ERROR org.opensaml.xml.encryption.Decrypter - Failed to decrypt EncryptedKey, valid decryption key could not be resolved[main] ERROR org.opensaml.xml.encryption.Decrypter - Failed to decrypt EncryptedData using either EncryptedData KeyInfoCredentialResolver or EncryptedKeyResolver + EncryptedKey KeyInfoCredentialResolver[main] ERROR org.opensaml.saml2.encryption.Decrypter - SAML Decrypter encountered an error decrypting element content這是我的 Java 代碼(抱歉,它仍然有很多調試輸出):/* * **************************************************************************************************** * Original source from: https://stackoverflow.com/questions/9422545/decrypting-encrypted-assertion-using-saml-2-0-in-java-using-opensaml * And hint about needed to add DefaultBootstrap.bootstrap() for OpenSAML 2.x: https://stackoverflow.com/questions/25066183/opensaml-error-receiving-correct-unmarshaller * And hing about chain resolvers: https://www.programcreek.com/java-api-examples/index.php?api=org.opensaml.saml2.encryption.Decrypter * **************************************************************************************************** * **************************************************************************************************** * **************************************************************************************************** * **************************************************************************************************** */import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import java.security.KeyFactory;import java.security.interfaces.RSAPrivateKey;import java.security.spec.PKCS8EncodedKeySpec;import java.util.ArrayList;import java.util.List;
查看完整描述

2 回答

?
元芳怎么了

TA貢獻1798條經驗 獲得超7個贊

僅供參考,一旦我找到正確的私鑰以匹配示例加密斷言,我終于可以按原樣工作。



查看完整回答
反對 回復 2022-06-15
?
達令說

TA貢獻1821條經驗 獲得超6個贊

通過您的更改,我得到了 KEY LENGTH 已知錯誤,在點擊以下鏈接后問題已解決

org.apache.xml.security.encryption.XMLEncryptionException:非法密鑰大小原始異常是 java.security.InvalidKeyException:非法密鑰大小

https://faq.miniorange.com/knowledgebase/i-am-getting-org-apache-xml-security-encryption-xmlencryptionexception-illegal-key-size-exception-sso/


查看完整回答
反對 回復 2022-06-15
  • 2 回答
  • 0 關注
  • 258 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號