Example usage for java.security SecureClassLoader SecureClassLoader

List of usage examples for java.security SecureClassLoader SecureClassLoader

Introduction

In this page you can find the example usage for java.security SecureClassLoader SecureClassLoader.

Prototype

protected SecureClassLoader() 

Source Link

Document

Creates a new SecureClassLoader using the default parent class loader for delegation.

Usage

From source file:net.nicholaswilliams.java.licensing.encryption.TestRSAKeyPairGenerator.java

@Override
public ClassLoader getClassLoader(Location location) {
    return new SecureClassLoader() {
        @Override/*from  ww w  .  j  ava  2s. co  m*/
        protected Class<?> findClass(String name) throws ClassNotFoundException {
            byte[] b = MockClassFileManager.this.javaClassObject.getBytes();
            return super.defineClass(name, MockClassFileManager.this.javaClassObject.getBytes(), 0, b.length);
        }
    };
}