ch11: sample code

This commit is contained in:
Luciano Ramalho
2020-06-09 01:16:38 -03:00
parent 5a4065c73c
commit 70132a37c2
14 changed files with 946 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
from java.lang.reflect import Modifier
import Confidential
message = Confidential('top secret text')
fields = Confidential.getDeclaredFields()
for field in fields:
# list private fields only
if Modifier.isPrivate(field.getModifiers()):
field.setAccessible(True) # break the lock
print 'field:', field
print '\t', field.getName(), '=', field.get(message)