public class SignedContentImpl extends Object implements SignedContent
| Modifier and Type | Class and Description |
|---|---|
class |
SignedContentImpl.SignedContentEntryImpl |
| Constructor and Description |
|---|
SignedContentImpl(SignerInfo[] signerInfos,
Map<String,Object> contentMDResults) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkValidity(SignerInfo signer)
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.
|
public SignedContentImpl(SignerInfo[] signerInfos, Map<String,Object> contentMDResults)
public 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(String name)
SignedContentgetSignedEntry in interface SignedContentname - the name of the entrypublic SignerInfo[] getSignerInfos()
SignedContentSignedContent. If the content
is not signed then an empty array is returned.getSignerInfos in interface SignedContentSignedContentpublic Date getSigningTime(SignerInfo signerInfo)
SignedContentgetSigningTime in interface SignedContentsignerInfo - the signer info to get the signing time forpublic SignerInfo getTSASignerInfo(SignerInfo signerInfo)
SignedContentgetTSASignerInfo in interface SignedContentsignerInfo - the signer info to get the TSA signer forpublic boolean isSigned()
SignedContentSignedContent.getSignerInfos().length > 0isSigned in interface SignedContentpublic void checkValidity(SignerInfo signer) throws CertificateExpiredException, 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 SignedContentsigner - the signer info to check validity for.CertificateExpiredException - if one of the certificates of this signer is expiredCertificateNotYetValidException - if one of the certificates of this signer is not yet validCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.