|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.baseadaptor.bundlefile.BundleFile
org.eclipse.osgi.internal.signedcontent.SignedBundleFile
public class SignedBundleFile
This class wraps a Repository of classes and resources to check and enforce signatures. It requires full signing of the manifest by all signers. If no signatures are found, the classes and resources are retrieved without checks.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.osgi.baseadaptor.bundlefile.BundleFile |
|---|
basefile, PROP_SETPERMS_CMD |
| Fields inherited from interface org.eclipse.osgi.internal.signedcontent.SignedContentConstants |
|---|
AUTHORIZATION_ENGINE, DEFAULT_AUTHORIZATION_ENGINE, DEFAULT_TRUST_ENGINE, digestManifestSearch, digestManifestSearchLen, DOT_DSA, DOT_RSA, DOT_SF, DSA_OID, EMPTY_STRING, MD2_OID, MD2_STR, MD5_OID, MD5_STR, META_INF, META_INF_MANIFEST_MF, MF_DIGEST_PART, MF_ENTRY_NAME, MF_ENTRY_NEWLN_NAME, RSA_OID, SHA1_OID, SHA1_STR, SIG_DASH, SIGNEDDATA_OID, SIGNING_TIME, TIMESTAMP_OID, TIMESTAMP_TST_OID, TRUST_ENGINE |
| Method Summary | |
|---|---|
void |
checkValidity(SignerInfo signerInfo)
Checks if the certificates are valid for the specified signer. |
void |
close()
Closes the BundleFile. |
boolean |
containsDir(java.lang.String dir)
Determines if any BundleEntries exist in the given directory path. |
java.io.File |
getBaseFile()
Returns the base file for this BundleFile |
BundleEntry |
getEntry(java.lang.String path)
Locates a file name in this bundle and returns a BundleEntry object |
java.util.Enumeration |
getEntryPaths(java.lang.String path)
Allows to access the entries of the bundle. |
java.io.File |
getFile(java.lang.String path,
boolean nativeCode)
Returns a File for the bundle entry specified by the path. |
SignedContentEntry[] |
getSignedEntries()
Returns all entries of the content. |
SignedContentEntry |
getSignedEntry(java.lang.String name)
Returns the signed entry for the specified name. |
SignerInfo[] |
getSignerInfos()
Returns all the signer infos for this SignedContent. |
java.util.Date |
getSigningTime(SignerInfo signerInfo)
Returns the signing time for the signer info. |
SignerInfo |
getTSASignerInfo(SignerInfo signerInfo)
Returns the TSA signer info used to authenticate the signer time of a signer info. |
boolean |
isSigned()
Returns true if the content is signed; false otherwise. |
void |
open()
Opens the BundleFiles. |
| Methods inherited from class org.eclipse.osgi.baseadaptor.bundlefile.BundleFile |
|---|
fixTrailingSlash, getResourceURL, getResourceURL, getResourceURL, setPermissions, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.io.File getFile(java.lang.String path,
boolean nativeCode)
BundleFile
getFile in class BundleFilepath - The path to the entry to locate a File for.nativeCode - true if the path is native code.
public BundleEntry getEntry(java.lang.String path)
BundleFile
getEntry in class BundleFilepath - path of the entry to locate in the bundle
public java.util.Enumeration getEntryPaths(java.lang.String path)
BundleFile
getEntryPaths in class BundleFilepath - path of the entry to locate in the bundle
public void close()
throws java.io.IOException
BundleFile
close in class BundleFilejava.io.IOException - if any error occurs.
public void open()
throws java.io.IOException
BundleFile
open in class BundleFilejava.io.IOException - if any error occurs.public boolean containsDir(java.lang.String dir)
BundleFile
containsDir in class BundleFiledir - The directory path to check existence of.
public java.io.File getBaseFile()
BundleFile
getBaseFile in class BundleFilepublic SignedContentEntry[] getSignedEntries()
SignedContentSignedContentEntry.verify() and
get signer info for each entry in this content using SignedContentEntry.getSignerInfos().
Note that this operation may be expensive because it requires an
exhaustive search for entries over the entire content.
Unsigned entries are included in the result. Entries for which signer info exists but no content is found are also returned. For example, when an entry is removed from a signed jar but the jar is not resigned, the signer thinks the entry should exist but the content got removed. This would be considered an invalid entry which would fail verification.
getSignedEntries in interface SignedContentpublic SignedContentEntry getSignedEntry(java.lang.String name)
SignedContent
getSignedEntry in interface SignedContentname - the name of the entry
public SignerInfo[] getSignerInfos()
SignedContentSignedContent. If the content
is not signed then an empty array is returned.
getSignerInfos in interface SignedContentSignedContentpublic java.util.Date getSigningTime(SignerInfo signerInfo)
SignedContent
getSigningTime in interface SignedContentsignerInfo - the signer info to get the signing time for
public SignerInfo getTSASignerInfo(SignerInfo signerInfo)
SignedContent
getTSASignerInfo in interface SignedContentsignerInfo - the signer info to get the TSA signer for
public boolean isSigned()
SignedContentSignedContent.getSignerInfos().length > 0
isSigned in interface SignedContent
public void checkValidity(SignerInfo signerInfo)
throws java.security.cert.CertificateExpiredException,
java.security.cert.CertificateNotYetValidException
SignedContentSignedContent.getSigningTime(SignerInfo) then that time is used to check the
validity of the certificates; otherwise the current time is used.
checkValidity in interface SignedContentsignerInfo - the signer info to check validity for.
java.security.cert.CertificateExpiredException - if one of the certificates of this signer is expired
java.security.cert.CertificateNotYetValidException - if one of the certificates of this signer is not yet valid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||