Android Key Create generateKey(String key)

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

Description

generate Key

Declaration

private static Key generateKey(String key) throws Exception 

Method Source Code

//package com.java2s;
import java.security.Key;

import javax.crypto.spec.SecretKeySpec;

public class Main {
    private static Key generateKey(String key) throws Exception {
        try {/*w ww.  j ava2 s  .  co m*/
            SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES");
            return keySpec;
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }

    }
}

Related

  1. generateKey(byte[] randomSeed)
  2. getRawKey(byte[] seed)
  3. getRawKey(byte[] seed)
  4. createRandomKey(int size)