我想手動創建Web服務調用的簽名標記。我從密鑰庫訪問證書並訪問證書的公鑰。我現在有問題將RSAKeyValue轉換爲ds:CryptoBinary類型。代碼返回了用於mudulus和exponent的Biginteger值,我正在尋找一種方法或算法將它們轉換爲八位組,然後轉換爲Bas64。這裏是我的代碼從BigInteger轉換爲八位字節?
RSAPublicKey rsaKey = (RSAPublicKey)certificate.getPublicKey();
customSignature.Modulus = rsaKey.getModulus();
customSignature.Exponent = rsaKey.getPublicExponent();
在Java中有沒有解決方案可用於將整數轉換爲八位組表示?
謝謝,它很簡單 – 2011-01-31 14:29:15