| 915 | } |
| 916 | |
| 917 | public static Element decryptElementAES(byte[] data, byte[] secretKey) |
| 918 | throws SecurityException { |
| 919 | Element result; |
| 920 | |
| 921 | try { |
| 922 | byte[] after = Crypto.decryptAES(data, secretKey); |
| 923 | ByteArrayInputStream input = new ByteArrayInputStream(after); |
| 924 | result = Abdera.getInstance().getParser().parse(input).getRoot(); |
| 925 | } catch (Exception e) { |
| 926 | log.error("Error while decrypting: ", e); |
| 927 | throw new SecurityException(e); |
| 928 | } |
| 929 | return result; |
| 930 | } |
| 931 | |
| 932 | private final static org.slf4j.Logger log = org.slf4j.LoggerFactory |
| 933 | .getLogger(Client.class); |