Code example for DESedeKeySpec

0
	} 
	 
	public static Key getKey() {
		try { 
			byte[] bytes = KEY_STRING.getBytes();
			DESedeKeySpec pass = new DESedeKeySpec(bytes);
			SecretKeyFactory skf = SecretKeyFactory.getInstance(TRIPLE_DES_KEY_SPEC); 
			SecretKey s = skf.generateSecret(pass); 
			return s;
		} catch (Throwable t) {
			throw new RuntimeException("Error creating key", t);
		} 
	} 
	 
	public static final String TRIPLE_DES_KEY_SPEC = "DESede";
	public static final String TRIPLE_DES = "DESede/ECB/PKCS5Padding";
	private static final String KEY_STRING =
		"21-199-217-127-162-182-251-137-227-56-131-242-191-224-21-97-146-158-152-21-124-70-127-91"; 
	 
} 
Contextual code suggestions in your IDE  Get Codota for Java