org.eclipse.osgi.internal.signedcontent
Class SignedContentFile

java.lang.Object
  extended by org.eclipse.osgi.internal.signedcontent.SignedContentFile
All Implemented Interfaces:
SignedContent

public class SignedContentFile
extends Object
implements SignedContent


Nested Class Summary
 class SignedContentFile.SignedContentFileEntry
           
 
Constructor Summary
SignedContentFile(SignedContentImpl signedContent)
           
 
Method Summary
 void checkValidity(SignerInfo signerInfo)
          Checks if the certificates are valid for the specified signer.
 SignedContentEntry[] getSignedEntries()
          Returns all entries of the content.
 SignedContentEntry getSignedEntry(String name)
          Returns the signed entry for the specified name.
 SignerInfo[] getSignerInfos()
          Returns all the signer infos for this SignedContent.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SignedContentFile

public SignedContentFile(SignedContentImpl signedContent)
Method Detail

checkValidity

public void checkValidity(SignerInfo signerInfo)
                   throws CertificateExpiredException,
                          CertificateNotYetValidException
Description copied from interface: SignedContent
Checks if the certificates are valid for the specified signer. If the signer has a singing time returned by SignedContent.getSigningTime(SignerInfo) then that time is used to check the validity of the certificates; otherwise the current time is used.

Specified by:
checkValidity in interface SignedContent
Parameters:
signerInfo - the signer info to check validity for.
Throws:
CertificateExpiredException - if one of the certificates of this signer is expired
CertificateNotYetValidException - if one of the certificates of this signer is not yet valid

getSignedEntries

public SignedContentEntry[] getSignedEntries()
Description copied from interface: SignedContent
Returns all entries of the content. The returned entries can be used to verify the entry content using SignedContentEntry.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.

Specified by:
getSignedEntries in interface SignedContent
Returns:
all entries of the content

getSignedEntry

public SignedContentEntry getSignedEntry(String name)
Description copied from interface: SignedContent
Returns the signed entry for the specified name.

Specified by:
getSignedEntry in interface SignedContent
Parameters:
name - the name of the entry
Returns:
the entry or null if the entry could not be found

getSignerInfos

public SignerInfo[] getSignerInfos()
Description copied from interface: SignedContent
Returns all the signer infos for this SignedContent. If the content is not signed then an empty array is returned.

Specified by:
getSignerInfos in interface SignedContent
Returns:
all the signer infos for this SignedContent

getSigningTime

public Date getSigningTime(SignerInfo signerInfo)
Description copied from interface: SignedContent
Returns the signing time for the signer info. If no TSA signers exist then null is returned

Specified by:
getSigningTime in interface SignedContent
Parameters:
signerInfo - the signer info to get the signing time for
Returns:
the signing time

getTSASignerInfo

public SignerInfo getTSASignerInfo(SignerInfo signerInfo)
Description copied from interface: SignedContent
Returns the TSA signer info used to authenticate the signer time of a signer info.

Specified by:
getTSASignerInfo in interface SignedContent
Parameters:
signerInfo - the signer info to get the TSA signer for
Returns:
the TSA signer info

isSigned

public boolean isSigned()
Description copied from interface: SignedContent
Returns true if the content is signed; false otherwise. This is a convenience method equivalent to calling SignedContent.getSignerInfos().length > 0

Specified by:
isSigned in interface SignedContent
Returns:
true if the content is signed


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.