A C E F G H I J L M N O P R S T U

A

addMessage(Exception) - Method in class org.freshcookies.security.policy.PolicyReader
Adds an Exception to the list of parsing errors.

C

canonicalize(CodeSource, Properties) - Method in class org.freshcookies.security.policy.Canonicalizer
Canonicalizes a CodeSource.
canonicalize(Permission) - Method in class org.freshcookies.security.policy.Canonicalizer
Normalizes permissions by changing permission targets to canonical forms.
Canonicalizer - Class in org.freshcookies.security.policy
Utility class that canonicalizes Permissions and file paths.
Canonicalizer() - Constructor for class org.freshcookies.security.policy.Canonicalizer
Constructs a new Canonicalizer instance.
CertificateDN - Class in org.freshcookies.security.cert
Lightweight wrapper object for an X.509 certificate distinguished name.
CertificateDN(Principal) - Constructor for class org.freshcookies.security.cert.CertificateDN
Constructs a new CertificateDN by parsing a supplied Principal from a certificate, such as X509Certificate.getSubjectDN() or X509Certificate.getIssuerDN().
commit() - Method in class org.freshcookies.security.cert.Trustee
Writes the trust store to disk.
compare(Object, Object) - Method in class org.freshcookies.security.policy.PrincipalComparator
 

E

equals(Object) - Method in class org.freshcookies.security.policy.GenericPrincipal
 
equals(Object) - Method in class org.freshcookies.security.policy.LocalPolicy.AnyPrincipal
 
extractCACertificates(JarFile) - Method in class org.freshcookies.security.cert.JarHelper
Extracts the CA certificates from a Jar file.
extractCodeBaseUrl(String) - Method in class org.freshcookies.security.policy.PolicyReader
Extracts the URL from a codeBase token string.
extractPermissionCollection(String) - Method in class org.freshcookies.security.policy.PolicyReader
Parses permissions from a grant block and returns a PermissionCollection.
extractPrincipal(String) - Method in class org.freshcookies.security.policy.PolicyReader
Extracts the Principal from a principal token string.
extractSigningCertificates(JarFile) - Method in class org.freshcookies.security.cert.JarHelper
Extracts the signing certificates from a Jar file.
extractSigningCertificates(String) - Method in class org.freshcookies.security.policy.PolicyReader
Extracts and resolves signing Certificates from a signedBy token string.
extractSSLCertificates(String, int) - Static method in class org.freshcookies.security.cert.SSLHelper
Helper method that connects to a specified host using SSL and extracts the server's peer certificates.

F

findAlias(KeyStore, Certificate) - Static method in class org.freshcookies.security.policy.PolicyReader
Examines a Keystore and returns the alias that matches a given signing Certificate.
findClass(String) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Looks up and returns a Class matching a supplied fully-qualified type name.
findPolicies() - Static method in class org.freshcookies.security.policy.PolicyReader
Static method that identifies the active security policies for the JVM and returns an array of PolicyReader objects (one for each active policy).
format(CodeSource) - Static method in class org.freshcookies.security.policy.Canonicalizer
Formats a CodeSource for use with a policy file.
format(Principal[]) - Static method in class org.freshcookies.security.policy.Canonicalizer
Formats an array of Principals; the array may be null.
format(Principal[], boolean) - Static method in class org.freshcookies.security.policy.Canonicalizer
Formats an array of CachedPrincipals, optionally with line delimeters suitable for a policy file.
format(Principal) - Static method in class org.freshcookies.security.policy.Canonicalizer
Formats a CachedPrincipal for use with a policy file.
format(Permission) - Static method in class org.freshcookies.security.policy.Canonicalizer
Formats a CachedPermission for use in a policy file or log file.

G

GenericPrincipal - Class in org.freshcookies.security.policy
Simple Principal class.
GenericPrincipal(String) - Constructor for class org.freshcookies.security.policy.GenericPrincipal
Constructs a new GenericPrincipal with a supplied name.
getAlias(X509Certificate) - Static method in class org.freshcookies.security.cert.Trustee
Calculates an alias for a certificate by trying the common name, organizational unit, DC and serial number in succession.
getCertificateInfo(X509Certificate) - Static method in class org.freshcookies.security.cert.Trustee
Returns a string containing verbose certificate information.
getClassLoader() - Method in class org.freshcookies.security.policy.LocalPolicy.LocalProtectionDomain
Returns the ClassLoader used to construct the LocalProtectionDomain, which may be null.
getCodeSource() - Method in class org.freshcookies.security.policy.LocalPolicy.LocalProtectionDomain
Returns the CodeSource used to construct the LocalProtectionDomain, which may be null.
getCodeSource(String) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the CodeSource that corresponds to a supplied String, without canonicalizing the path prior to returning it.
getCodeSource(String, boolean) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the CodeSource corresponding on a specified file path.
getCodeSourceCount() - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the number of CodeSource objects cached by this factory since the last time SecurityTokenFactory.reset() was called.
getCommonName() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the common name
getCountry() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the country.
getDomainComponent() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the domain component.
getEmail() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the email.
getException() - Method in class org.freshcookies.security.policy.UnresolvedPrincipal
Returns the Exception used to instantiate this UnresolvedPrincipal.
getFile() - Method in class org.freshcookies.security.policy.PolicyReader
Returns the File object used to instantiate this PolicyReader.
getKeyStore() - Method in class org.freshcookies.security.policy.PolicyReader
Returns the keystore associated with the policy file, if one is specified in the policy.
getLocality() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the locality.
getMessages() - Method in class org.freshcookies.security.policy.PolicyReader
The parsing errors encountered by PolicyReader when the PolicyReader.read() method was last invoked.
getName() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the distinguished name.
getName() - Method in class org.freshcookies.security.policy.GenericPrincipal
 
getName() - Method in class org.freshcookies.security.policy.LocalPolicy.AnyPrincipal
 
getName() - Method in class org.freshcookies.security.policy.UnresolvedPrincipal
Returns the name of the principal.
getOrganization() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the organization.
getOrganizationalUnit() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the organizational unit.
getPathSubstitutions() - Static method in class org.freshcookies.security.policy.Canonicalizer
Returns a Map of key/value pairs that correspond the subset of System properties that correspond to valid file paths.
getPermission(String) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the Permission that corresponds to a supplied String, without canonicalizing the Permission prior to returning it.
getPermission(String, boolean) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the Permission that corresponds to a supplied String.
getPermissions() - Method in class org.freshcookies.security.policy.LocalPolicy.LocalProtectionDomain
Returns the PermissionCollection used to construct the LocalProtectionDomain, which may be null.
getPermissonCount() - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the number of Permission objects cached by this factory since the last time SecurityTokenFactory.reset() was called.
getPrincipal(String) - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the Principal that corresponds to a supplied String containing the name of the Principal class and the Principal's name, separated by spaces.
getPrincipalClass() - Method in class org.freshcookies.security.policy.UnresolvedPrincipal
Returns the class of the unresolved Principal as a String.
getPrincipalCount() - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Returns the number of Principal objects cached by this factory since the last time SecurityTokenFactory.reset() was called.
getPrincipals() - Method in class org.freshcookies.security.policy.LocalPolicy.LocalProtectionDomain
Returns the Principal array used to construct the LocalProtectionDomain, if supplied, or a zero-length array if not supplied.
getProtectionDomains() - Method in class org.freshcookies.security.policy.PolicyReader
Returns the ProtectionDomains parsed by the PolicyReader.read() method.
getSigner(Class) - Static method in class org.freshcookies.security.policy.PolicyReader
Static method that returns the certificate used to sign a particular class.
getState() - Method in class org.freshcookies.security.cert.CertificateDN
Returns the state.

H

hashCode() - Method in class org.freshcookies.security.policy.GenericPrincipal
 
hashCode() - Method in class org.freshcookies.security.policy.LocalPolicy.AnyPrincipal
 

I

implies(ProtectionDomain, Permission) - Method in class org.freshcookies.security.policy.LocalPolicy
Returns true if the security policy grants a particular Permission to a ProtectionDomain whose code source, certificates and classloader match the one supplied as a parameter.
isSigned(Class) - Static method in class org.freshcookies.security.policy.PolicyReader
Returns true if a class is digitally signed.
isValid() - Method in class org.freshcookies.security.policy.PolicyReader
Returns true> if the security policy file was parsed correctly and validated without errors.
isVerified(Class) - Method in class org.freshcookies.security.policy.PolicyReader
Returns code if a supplied class' CodeSource is digitally signed, and the certificate used to sign it can be found in this PolicyReader's keystore.

J

JarHelper - Class in org.freshcookies.security.cert
Extracts certificates used to sign a specified JAR file and optionally save them to disk.
JarHelper() - Constructor for class org.freshcookies.security.cert.JarHelper
Constructs a new instance of JarHelper.

L

loadPolicy(File) - Method in class org.freshcookies.security.policy.PolicyReader
Protected method that loads the policy file into memory, scrubs contents of line breaks and extra whitespace, and returns it as a string.
LocalPolicy - Class in org.freshcookies.security.policy
Security policy class that implements a subset of Policy methods, using a standard Java 2 security policy file as input.
LocalPolicy(File) - Constructor for class org.freshcookies.security.policy.LocalPolicy
Constructs a new instance of a LocalPolicy object, whose policy rules are parsed from a supplied File using the standard Java platform encoding.
LocalPolicy(File, String) - Constructor for class org.freshcookies.security.policy.LocalPolicy
Constructs a new instance of a LocalPolicy object, whose policy rules are parsed from a supplied File using the standard Java platform encoding.
LocalPolicy.AnyPrincipal - Class in org.freshcookies.security.policy
Principal class that represents a non-class-specific Principal in a policy file grant block.
LocalPolicy.AnyPrincipal(String) - Constructor for class org.freshcookies.security.policy.LocalPolicy.AnyPrincipal
Constructs a new AnyPrincipal object with a given name.
LocalPolicy.LocalProtectionDomain - Class in org.freshcookies.security.policy
Lightweight re-implementation of ProtectionDomain that does not allow subsequent modifications to Permissions.
LocalPolicy.LocalProtectionDomain(CodeSource, PermissionCollection, ClassLoader, Principal[]) - Constructor for class org.freshcookies.security.policy.LocalPolicy.LocalProtectionDomain
Constructs a new LocalProtectionDomain.

M

main(String[]) - Static method in class org.freshcookies.security.cert.JarHelper
Convenience main method that extracts the signing certificates from a jar file and optionally saves them to disk and the system trust store.
main(String[]) - Static method in class org.freshcookies.security.cert.SSLHelper
 

N

NO_CODESOURCE - Static variable in class org.freshcookies.security.policy.Canonicalizer
Static String that means "no codesource."

O

org.freshcookies.security.cert - package org.freshcookies.security.cert
This package contains serveral useful utilities for managing common security operations, such as SSL certificate extraction, JAR certificate extraction, and policy file manipulation.
org.freshcookies.security.policy - package org.freshcookies.security.policy
Utility classes that parse and manipulate Java security policy files.

P

parseProtectionDomain(String, String) - Method in class org.freshcookies.security.policy.PolicyReader
Returns a valid ProtectionDomain by parsing a grant block that denotes the codebase, pricipals and signers to whom permissions should be granted.
PERMISSION_PATTERN - Static variable in class org.freshcookies.security.policy.SecurityTokenFactory
Pattern that matches permission string e.g., javax.security.auth.AuthPermission "setLoginConfiguration".
PolicyException - Exception in org.freshcookies.security.policy
Lightweight checked Exception subclass for propagating security policy parsing errors.
PolicyException(String) - Constructor for exception org.freshcookies.security.policy.PolicyException
 
PolicyReader - Class in org.freshcookies.security.policy
Parser that reads a Java 2 security policy file into memory.
PolicyReader(File) - Constructor for class org.freshcookies.security.policy.PolicyReader
Constructs a new PolicyReader for parsing a supplied policy File using the Java platform standard charset.
PolicyReader(File, String) - Constructor for class org.freshcookies.security.policy.PolicyReader
Constructs a new PolicyReader for parsing a supplied policy File.
PrincipalComparator - Class in org.freshcookies.security.policy
Comparator class for sorting objects of type Principal.
PrincipalComparator() - Constructor for class org.freshcookies.security.policy.PrincipalComparator
Constructs a new PrincipalComparator.
propertize(CodeSource, Properties) - Method in class org.freshcookies.security.policy.Canonicalizer
Formats a CodeSource, substituting properties into the CodeSource or path, as needed.
propertize(Permission, Properties) - Method in class org.freshcookies.security.policy.Canonicalizer
Substitutes properties into a given FilePermission's URL or path, as needed.

R

read() - Method in class org.freshcookies.security.policy.PolicyReader
Parses the security policy file, and loads its contents into memory.
refresh() - Method in class org.freshcookies.security.policy.LocalPolicy
Reloads the policy from the filesystem.
REGEX_JAVA_TYPE - Static variable in class org.freshcookies.security.policy.SecurityTokenFactory
Pattern that matches any valid Java type name, minus the .java or .class suffix.
reset() - Method in class org.freshcookies.security.policy.SecurityTokenFactory
Flushes the SecurityTokenFactory's caches and resets all counters.

S

samePrincipals(Principal[], Principal[]) - Method in class org.freshcookies.security.policy.LocalPolicy
Determines whether two Principal arrays contain the same items, which may appear in any order
saveCertificate(X509Certificate) - Method in class org.freshcookies.security.cert.Trustee
Saves an X.509 certificate as a binary file in the current directory.
secureExists(File) - Static method in class org.freshcookies.security.policy.PolicyReader
Returns true if a supplied File exists in the file system, and the SecurityManager (if running) has granted read access to it.
SecurityTokenFactory - Class in org.freshcookies.security.policy
Factory class that dynamically looks up, caches and returns Permission, Principal and CodeSource objects that correspond to supplied strings.
SecurityTokenFactory(URL[]) - Constructor for class org.freshcookies.security.policy.SecurityTokenFactory
Constructs a new instance of this class with a supplied set of supplemental URLs for locating classes.
SSL_PORT - Static variable in class org.freshcookies.security.cert.SSLHelper
Default SSL port.
SSLHelper - Class in org.freshcookies.security.cert
Extracts SSL certificates from a specified webserver and optionally adds them to the JSSE truststore.
SSLHelper() - Constructor for class org.freshcookies.security.cert.SSLHelper
Constructs a new SSLHelper.

T

toString() - Method in class org.freshcookies.security.policy.GenericPrincipal
 
toString() - Method in class org.freshcookies.security.policy.LocalPolicy.AnyPrincipal
 
toString() - Method in class org.freshcookies.security.policy.UnresolvedPrincipal
Returns a string representation of this Principal.
trustCACertificate(X509Certificate) - Method in class org.freshcookies.security.cert.Trustee
Adds a supplied CA certificate to the system certificate trust store as a "trusted CA certificate".
Trustee - Class in org.freshcookies.security.cert
Utility class that performs common certificate trust operations, such as writing to disk, updating the trust database and printing verbose certficate info.
Trustee() - Constructor for class org.freshcookies.security.cert.Trustee
Constructs a new Trustee instance, and initializes the system certificate authority (CA) keystore and SSL trust manager.

U

UnresolvedPrincipal - Class in org.freshcookies.security.policy
Represents a Principal whose class cannot be resolved by the classloader.
UnresolvedPrincipal(String, String) - Constructor for class org.freshcookies.security.policy.UnresolvedPrincipal
Constructs a new UnresolvedPrincipal.
UnresolvedPrincipal(String, String, Exception) - Constructor for class org.freshcookies.security.policy.UnresolvedPrincipal
Constructs a new UnresolvedPrincipal.

A C E F G H I J L M N O P R S T U