public final class SigningCertificateVerifier
extends java.lang.Object
A signature value on its own does not commit to the key that verifies it, so anything covering only the value, such
as a CAdES signature time-stamp or a CMS countersignature, covers the signer's certificate and the content only
when the signed attributes carry the certificate's hash and that hash is checked against the certificate the
signature verified under. verifySigningCertificate(SignerInformation, X509CertificateHolder,
DigestCalculatorProvider) is that check.
| Modifier and Type | Method and Description |
|---|---|
static org.bouncycastle.asn1.ess.ESSCertIDv2[] |
getSigningCertificateIDs(SignerInformation signer)
Return the certificate identifiers the signer's signed attributes carry: the first ESSCertID of a
signing-certificate attribute, as an ESSCertIDv2 naming SHA-1, and the first ESSCertIDv2 of a
signing-certificate-v2 attribute.
|
static void |
verifySigningCertificate(SignerInformation signer,
X509CertificateHolder cert,
DigestCalculatorProvider digCalcProv)
Check that the signer's signed attributes identify the given certificate: a signing-certificate or
signing-certificate-v2 attribute must be present, each identifier's hash must be the digest of the
certificate's encoding under the algorithm it names, and an issuerSerial, when present, must match the
certificate's issuer and serial number.
|
public static org.bouncycastle.asn1.ess.ESSCertIDv2[] getSigningCertificateIDs(SignerInformation signer) throws CMSException
signer - the signer to inspect.CMSException - if an attribute is present but malformed or empty, or appears only among the unsigned
attributes, where RFC 5035 sec. 3 forbids it.public static void verifySigningCertificate(SignerInformation signer, X509CertificateHolder cert, DigestCalculatorProvider digCalcProv) throws CMSException
signer - the signer to check.cert - the certificate the signature verifies under.digCalcProv - source of digest calculators for the certificate hash.CMSException - if the attribute is absent, malformed or in the wrong place, names a digest that is not
acceptable or cannot be calculated, or does not identify the certificate.