Java Key Create getKey(byte[] keyData)

Here you can find the source of getKey(byte[] keyData)

Description

Instantiates an AES key.

License

Open Source License

Parameter

Parameter Description
keyData The key bytes

Return

An AES key

Declaration

public static Key getKey(byte[] keyData) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.security.Key;

import javax.crypto.spec.SecretKeySpec;

public class Main {
    /**// w  ww.  j  a  va 2  s . co m
     * Instantiates an AES key.
     * 
     * @param keyData The key bytes
     * @return An AES key
     */
    public static Key getKey(byte[] keyData) {
        return new SecretKeySpec(keyData, "AES");
    }
}

Related

  1. getKey()
  2. getKey()
  3. getKey()
  4. getKey(byte[] arrayBytesTemp)
  5. getKey(InputStream is)
  6. getKey(int size)
  7. getKey(KeyStore keystore, String alias, String password)
  8. getKey(KeyStore keyStore, String password, String orgName)