# SecureClassLoader

public class **SecureClassLoader** extends [ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html)  

|---|---|---|
| Known Direct Subclasses [URLClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URLClassLoader.html) |---|---| | [URLClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URLClassLoader.html) | This class loader is responsible for loading classes and resources from a list of URLs which can refer to either directories or JAR files. | |||

This class extends ClassLoader with additional support for defining
classes with an associated code source and permissions which are
retrieved by the system policy by default.

### Protected Constructor Summary

|---|---|
|   | [SecureClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader.html#SecureClassLoader(java.lang.ClassLoader))([ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) parent) Creates a new SecureClassLoader using the specified parent class loader for delegation. |
|   | [SecureClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader.html#SecureClassLoader())() Creates a new SecureClassLoader using the default parent class loader for delegation. |

### Protected Method Summary

|---|---|
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader.html#defineClass(java.lang.String,%20byte[],%20int,%20int,%20java.security.CodeSource))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, byte\[\] b, int off, int len, [CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) cs) Converts an array of bytes into an instance of class Class, with an optional CodeSource. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader.html#defineClass(java.lang.String,%20java.nio.ByteBuffer,%20java.security.CodeSource))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) b, [CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) cs) Converts a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html` into an instance of class `Class`, with an optional CodeSource. |
| [PermissionCollection](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/PermissionCollection.html) | [getPermissions](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader.html#getPermissions(java.security.CodeSource))([CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) codesource) Returns the permissions for the given CodeSource object. |

### Inherited Method Summary

From class [java.lang.ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html)

|---|---|
| void | [clearAssertionStatus](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#clearAssertionStatus())() Sets the default assertion status for this class loader to false and discards any package defaults or class assertion status settings associated with the class loader. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#defineClass(java.lang.String,%20byte[],%20int,%20int,%20java.security.ProtectionDomain))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, byte\[\] b, int off, int len, [ProtectionDomain](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/ProtectionDomain.html) protectionDomain) Converts an array of bytes into an instance of class Class, with an optional ProtectionDomain. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#defineClass(java.lang.String,%20java.nio.ByteBuffer,%20java.security.ProtectionDomain))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) b, [ProtectionDomain](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/ProtectionDomain.html) protectionDomain) Converts a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html` into an instance of class Class, with an optional ProtectionDomain. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#defineClass(byte[],%20int,%20int))(byte\[\] b, int off, int len) *This method is deprecated. Replaced by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#defineClass(java.lang.String,%20byte[],%20int,%20int)`* |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [defineClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#defineClass(java.lang.String,%20byte[],%20int,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, byte\[\] b, int off, int len) Converts an array of bytes into an instance of class Class. |
| [Package](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Package.html) | [definePackage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#definePackage(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.net.URL))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) specTitle, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) specVersion, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) specVendor, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) implTitle, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) implVersion, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) implVendor, [URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html) sealBase) Defines a package by name in this ClassLoader. |
| [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [findClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findClass(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds the class with the specified [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name). |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [findLibrary](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findLibrary(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) libname) Returns the absolute path name of a native library. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [findLoadedClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findLoadedClass(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Returns the class with the given [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name) if this loader has been recorded by the Java virtual machine as an initiating loader of a class with that [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name). |
| [URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html) | [findResource](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findResource(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds the resource with the given name. |
| [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html)\> | [findResources](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findResources(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Returns an enumeration of `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html` objects representing all the resources with the given name. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [findSystemClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#findSystemClass(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds a class with the specified [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name), loading it if necessary. |
| [Package](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Package.html) | [getPackage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getPackage(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Returns a Package that has been defined by this class loader or any of its ancestors. |
| [Package\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Package.html) | [getPackages](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getPackages())() Returns all of the Packages defined by this class loader and its ancestors. |
| final [ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) | [getParent](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getParent())() Returns the parent class loader for delegation. |
| [URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html) | [getResource](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getResource(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds the resource with the given name. |
| [InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) | [getResourceAsStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getResourceAsStream(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Returns an input stream for reading the specified resource. |
| [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html)\> | [getResources](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getResources(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds all the resources with the given name. |
| static [ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) | [getSystemClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getSystemClassLoader())() Returns the system class loader for delegation. |
| static [URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html) | [getSystemResource](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getSystemResource(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Find a resource of the specified name from the search path used to load classes. |
| static [InputStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/InputStream.html) | [getSystemResourceAsStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getSystemResourceAsStream(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Open for reading, a resource of the specified name from the search path used to load classes. |
| static [Enumeration](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Enumeration.html)\<[URL](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/URL.html)\> | [getSystemResources](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#getSystemResources(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Finds all resources of the specified name from the search path used to load classes. |
| [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [loadClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#loadClass(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, boolean resolve) Loads the class with the specified [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name). |
| [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [loadClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#loadClass(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Loads the class with the specified [binary name](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/SecureClassLoader#name). |
| static boolean | [registerAsParallelCapable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#registerAsParallelCapable())() Registers the caller as parallel capable. |
| final void | [resolveClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#resolveClass(java.lang.Class<?>))([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> c) Links the specified class. |
| void | [setClassAssertionStatus](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#setClassAssertionStatus(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) className, boolean enabled) Sets the desired assertion status for the named top-level class in this class loader and any nested classes contained therein. |
| void | [setDefaultAssertionStatus](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#setDefaultAssertionStatus(boolean))(boolean enabled) Sets the default assertion status for this class loader. |
| void | [setPackageAssertionStatus](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#setPackageAssertionStatus(java.lang.String,%20boolean))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) packageName, boolean enabled) Sets the package default assertion status for the named package. |
| final void | [setSigners](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html#setSigners(java.lang.Class<?>,%20java.lang.Object[]))([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> c, [Object\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) signers) Sets the signers of a class. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Protected Constructors

#### protected
**SecureClassLoader**
([ClassLoader](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassLoader.html) parent)

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

If there is a security manager, this method first
calls the security manager's `checkCreateClassLoader`
method to ensure creation of a class loader is allowed.

<br />

##### Parameters

| parent | the parent ClassLoader |
|---|---|

##### Throws

| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkCreateClassLoader` method doesn't allow creation of a class loader. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityManager.html#checkCreateClassLoader()`

#### protected
**SecureClassLoader**
()

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

If there is a security manager, this method first
calls the security manager's `checkCreateClassLoader`
method to ensure creation of a class loader is allowed.

##### Throws

| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if a security manager exists and its `checkCreateClassLoader` method doesn't allow creation of a class loader. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityManager.html#checkCreateClassLoader()`

## Protected Methods

#### protected final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\>
**defineClass**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, byte\[\] b, int off, int len, [CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) cs)

Converts an array of bytes into an instance of class Class,
with an optional CodeSource. Before the
class can be used it must be resolved.


If a non-null CodeSource is supplied a ProtectionDomain is
constructed and associated with the class being defined.

<br />

##### Parameters

| name | the expected name of the class, or `null` if not known, using '.' and not '/' as the separator and without a trailing ".class" suffix. |
| b | the bytes that make up the class data. The bytes in positions `off` through `off+len-1` should have the format of a valid class file as defined by The Java™ Virtual Machine Specification. |
| off | the start offset in `b` of the class data |
| len | the length of the class data |
| cs | the associated CodeSource, or `null` if none |
|---|---|

##### Returns

- the `Class` object created from the data, and optional CodeSource.

##### Throws

| [ClassFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassFormatError.html) | if the data did not contain a valid class |
| [IndexOutOfBoundsException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IndexOutOfBoundsException.html) | if either `off` or `len` is negative, or if `off+len` is greater than `b.length`. |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if an attempt is made to add this class to a package that contains classes that were signed by a different set of certificates than this class, or if the class name begins with "java.". |
|---|---|

#### protected final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\>
**defineClass**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name, [ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) b, [CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) cs)

Converts a `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html`
into an instance of class `Class`, with an optional CodeSource.
Before the class can be used it must be resolved.


If a non-null CodeSource is supplied a ProtectionDomain is
constructed and associated with the class being defined.

<br />

##### Parameters

| name | the expected name of the class, or `null` if not known, using '.' and not '/' as the separator and without a trailing ".class" suffix. |
| b | the bytes that make up the class data. The bytes from positions `b.position()` through `b.position() + b.limit() -1` should have the format of a valid class file as defined by The Java™ Virtual Machine Specification. |
| cs | the associated CodeSource, or `null` if none |
|---|---|

##### Returns

- the `Class` object created from the data, and optional CodeSource.

##### Throws

| [ClassFormatError](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassFormatError.html) | if the data did not contain a valid class |
| [SecurityException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/SecurityException.html) | if an attempt is made to add this class to a package that contains classes that were signed by a different set of certificates than this class, or if the class name begins with "java.". |
|---|---|

#### protected [PermissionCollection](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/PermissionCollection.html)
**getPermissions**
([CodeSource](https://developers.google.com/j2objc/javadoc/jre/reference/java/security/CodeSource.html) codesource)

Returns the permissions for the given CodeSource object.


This method is invoked by the defineClass method which takes
a CodeSource as an argument when it is constructing the
ProtectionDomain for the class being defined.

<br />

##### Parameters

| codesource | the codesource. |
|---|---|

##### Returns

- the permissions granted to the codesource.