75.4. 暗号化アルゴリズムの指定
アルゴリズムを変更するには、JCE アルゴリズム名を指定します。アルゴリズムを変更する場合は、互換性のあるキーを使用する必要があります。
KeyGenerator generator = KeyGenerator.getInstance("DES");
CryptoDataFormat cryptoFormat = new CryptoDataFormat("DES", generator.generateKey());
cryptoFormat.setShouldAppendHMAC(true);
cryptoFormat.setMacAlgorithm("HmacMD5");
from("direct:hmac-algorithm")
.marshal(cryptoFormat)
.to("mock:encrypted")
.unmarshal(cryptoFormat)
.to("mock:unencrypted");Java 7 で使用可能なアルゴリズムのリストは、Java 暗号化アーキテクチャー標準アルゴリズム名のドキュメントから入手できます。