Java AES getAesKey(String key)

Here you can find the source of getAesKey(String key)

Description

get Aes Key

License

Apache License

Declaration

private static SecretKeySpec getAesKey(String key) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;

public class Main {
    private static SecretKeySpec getAesKey(String key) {
        final byte[] symKeyData = DatatypeConverter.parseHexBinary(key);
        return new SecretKeySpec(symKeyData, "AES");
    }/*from  w  w w .  j av a 2s .c  o m*/
}

Related

  1. createSessionKey()
  2. decrypt(String encryptedText, String key)
  3. decrypt_aes(String key, String initVector, String encrypted)
  4. encryptAes(String value)
  5. encryptDecrypt(int mode, String data, String key, String salt, String iv)