Red Hat Training

A Red Hat training course is available for Red Hat Fuse

73.3. 暗号化アルゴリズムの指定

アルゴリズムの変更は、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 Cryptography Architecture Standard Algorithm Name Documentation』で確認できます。