알고리즘을 변경하는 것은 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");
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");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
Java 7에서 사용 가능한 알고리즘 목록은 Java Cryptography Architecture Standard Algorithm Name 설명서를 통해 사용할 수 있습니다.