@ Inject public void setKey ( @ Named ( NetworkConfig . AES_KEY ) String key ) throws Exception { final byte [ ] raw = key . getBytes ( NetworkConfig . getStringEncodingCharset ( ) ) ; final int keySize = raw . length ; if ( ( keySize % 16 ) == 0 || ( keySize % 24 ) == 0 || ( keySize % 32 ) == 0 ) { this . skeySpec = new SecretKeySpec ( raw , "AES" ) ; //$NON-NLS-1$ // this.cipher = Cipher.getInstance(ALGORITHM); } else { throw new IllegalArgumentException ( Messages . AESEventEncrypter_0 ) ; } }
Change the encryption key .