Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.security.Key;

import javax.crypto.spec.SecretKeySpec;

public class Main {
    public static Key byteArrayKeyToSecurityKeyUsingLength(byte[] key) throws Exception {
        return new SecretKeySpec(key, 0, key.length, "AES");
    }
}