Accessing Security.getImpl outside the package using

Vishal Goenka (vgoenka@novell.com)
Thu, 27 Aug 1998 23:17:19 -0600

The java.security.cert.CertificateFactory class uses java.lang.reflect.Acce=
ssibleObject interface setAccessible() to access the Security.getImpl() =
method, which has a package scope only.=20

My question is :=20
Is it possible to access package methods (or for that matter, private =
methods) using the java reflection APIs in this way. (Assuming that the =
setAccessible is invoked as a privileged action.) What are the restrictions=
(if any) on such an invocation ?

If there aren't any restrictions, then does this constitute a violation of =
the java language semantics. How does one specify that the private/package =
methods of a certain class aren't accessible using these reflection =
constructs.

Vishal Goenka
Novell