Verify signature without intermediate certificates


Lexicore

Is it possible to verify signatures with only ancestor or root certificates in the hierarchy?

Disclaimer: I'm new to certificate handling, so please forgive the simplistic terminology.

Consider the following situation.

  • We have two parties ( for the identity provider we call it the IdP and for the service provider we call it the SP ), and some central certificate authority CAs that are definitely trusted by both the IdP and the SP.
  • The CA has its own certificate , CertCA , known to both the IdP and SP (imported into the IdP's and SP's keystores with some alias)
  • Out CA issues an IdP certificate ( CertIdP ) and a SP certificate ( CertSP ).
  • The IdP has the CertIdP in its keystore and knows its password, so the IdP can use the CertIdP to sign messages
  • same for SP/CertSP
  • Now, suppose the SP doesn't know CertIdP, and the IdP doesn't know CertSP. They only know the CertCA used to sign the CertIdP and CertSP. (As I understand, we have a certificate hierarchy CertIdP->CertCA <-CertSP here-)
  • The IdP wants to send the signed message to the SP. It creates a message and then signs it with CertIdP.
  • The SP receives the message signed by the IdP using CertIdP. As mentioned above, the SP does not have a CertIdP, only the parent certificate CertCA.

My question is: Can an SP verify the signature of a message signed by CertIdP only by its parent certificate, CertCA?

Backstory, why.

We are implementing SAML based SSO with PicketLink. We are using PicketLink's SAML2SignatureValidationHandler to validate the signature. For this, the Service Provider (SP) needs to have the IdP's certificate in its keystore. When passing a signed SAML assertion to the SP, this handler will use the IdP's certificate to verify the signature.

The above process is working fine, but we have some organizational concerns. This procedure assumes that the SP has the IdP's certificate for verification. In case of changes, the IdP's certificate must be replaced on the SP side. We probably have a large number of SPs (hundreds, not thousands), so it's quite an effort.

Since both CertIdP and CertSP are issued by the same authority (CA), which is absolutely trusted by both IdP and SP, we thought that the CA's certificate could be used for signature verification. If feasible, the need to exchange certificates between the IdP and SP can be eliminated. CA's certificates are also "long lived", so they only need to be exchanged once in case of permanence (in our case, permanence is about 10-20 years).

However, I'm not sure if it's technically possible to use just the parent CertCA to verify a signature signed with CertIdP. Is it possible? Or are we going the wrong way here?

If relevant, we're on a Java/JBoss platform on the SP side and the IdP is 3rd party software.

renew:

This is the signature I currently get from the IdP:

    <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:SignedInfo>
            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
            <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
            <ds:Reference URI="#_...">
                <ds:Transforms>
                    <ds:Transform
                        Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                    <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                        <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"
                            PrefixList="ds saml samlp" />
                    </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <ds:DigestValue>r...=</ds:DigestValue>
            </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue>X...==</ds:SignatureValue>
    </ds:Signature>
Christopher R

It depends on whether your SAML response includes the signing certificate or <ds:X509Data>...</ds:X509Data>just its public key <ds:KeyValue>...</ds:KeyValue>.

<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" ...>
  ...
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:SignedInfo>...</ds:SignedInfo
    <ds:SignatureValue>...</ds:SignatureValue>
    <ds:KeyInfo>
      <ds:X509Data>
        <ds:X509Certificate>...</ds:X509Certificate>
      </ds:X509Data>
    </ds:KeyInfo>
  </ds:Signature>
</saml2p:Response>

and

<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" ...>
  ...
  <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <ds:SignedInfo>...</ds:SignedInfo
    <ds:SignatureValue>...</ds:SignatureValue>
    <ds:KeyInfo>
      <ds:KeyValue>
        <ds:RSAKeyValue>
          <ds:Modulus>...</ds:Modulus>
          <ds:Exponent>...</ds:Exponent>
        </ds:RSAKeyValue>
      </ds:KeyValue>
    </ds:KeyInfo>
  </ds:Signature>
</saml2p:Response>

If a signed certificate is embedded, it may contain the AuthorityInfoAccess extension, which usually contains the http or ldap URL that issued the CA's certificate. Using these extensions from signed certificates to trusted CA certificates, you will be able to build trusted certificate chains. (Note: If CertCA is actually the direct issuer of CertIdP and CertSP, you already have the required trusted certificate chain.)

However, if you only got the public key, you'll need a signing certificate on hand to match it. So it boils down to a configuration/distribution issue. You can provide a web service that returns the corresponding signing certificate for the requested public key. If the signing certificate is not found in the SP's local keystore, it will contact the web service to retrieve the new CertIdP and add it to the local keystore. Keeping a local keystore is related to performance, availability and privacy.

Related


Verify signature without intermediate certificates

Lexicore Is it possible to verify signatures with only ancestor or root certificates in the hierarchy? Disclaimer: I'm new to certificate handling, so please forgive the simplistic terminology. Consider the following situation. We have two parties ( for the id

Verify signature without intermediate certificates

Lexicore Is it possible to verify signatures with only ancestor or root certificates in the hierarchy? Disclaimer: I'm new to certificate handling, so please forgive the simplistic terminology. Consider the following situation. We have two parties ( for the id

Verify signature without intermediate certificates

Lexicore Is it possible to verify signatures with only ancestor or root certificates in the hierarchy? Disclaimer: I'm new to certificate handling, so please forgive the simplistic terminology. Consider the following situation. We have two parties ( for the id

Verify git commit without gpg signature

Nico We started using git as a VCS and previously used SVN and found that in git you can easily discover the real people behind changes and commits. Now we wonder why this design choice was made and if there is something we overlooked. Let's assume the followi

GPG - Verify signature without creating a chain of trust?

J Is it possible to ask gpg (or gpg4win) to only verify that a file is signed by a specific public key file, without having to import, sign and trust that key? i.e. like gpg --using-key pubkey.txt --verify message.txt instead of having to create your own priv

Verify git commit without gpg signature

Nico We started using git as a VCS and previously used SVN and found that in git you can easily discover the real people behind changes and commits. Now we wonder why this design choice was made and if there is something we overlooked. Let's assume the followi

GPG - Verify signature without creating a chain of trust?

J Is it possible to ask gpg (or gpg4win) to only verify that a file is signed by a specific public key file, without having to import, sign and trust that key? i.e. like gpg --using-key pubkey.txt --verify message.txt instead of having to create your own priv

Install intermediate CA certificates

Harvey I have a Kubernetes cluster hosting my own docker registry built with the following docs : https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/registry and https://github.com/kubernetes/kubernetes /blob/master/cluster/addons/registry/tls

Are intermediate certificates cached in Firefox?

Kit Sunde If someone visits Site A with a GoDaddy-issued certificate that also provides an intermediate certificate between GoDaddy and its CA, then Firefox will cache that intermediate certificate and compare it with a site that also has a GoDaddy-issued cert

Are intermediate certificates cached in Firefox?

Kit Sunde If someone visits Site A with a GoDaddy-issued certificate that also provides an intermediate certificate between GoDaddy and its CA, then Firefox will cache that intermediate certificate and compare it with a site that also has a GoDaddy-issued cert

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

Verify JWT token signature without decoding it in PyJWT library

Helen Is it possible to verify JWT token signature without decoding it in PyJWT library? Francesco Pegoraro I don't know if I know what you're asking, but I'll try anyway. The whole JWT standard is well explained at this link . Essentially, if I understand you

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

Verify JWT token signature without decoding it in PyJWT library

Helen Is it possible to verify JWT token signature without decoding it in PyJWT library? Francesco Pegoraro I don't know if I know what you're asking, but I'll try anyway. The whole JWT standard is well explained at this link . Essentially, if I understand you

Verify EC SHA 256 signature in .net without bouncy castle

Zatzman I am implementing Apple's App Attestation service. As part of the process, I receive an EC key and a signature. Example key: -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEd34IR9wYL76jLyZ148O/hjXo9iaF z/q/xEMXCwYPy6yxbxYzWDZPegG4FH+snXa

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

Verify JWT token signature without decoding it in PyJWT library

Helen Is it possible to verify JWT token signature without decoding it in PyJWT library? Francesco Pegoraro I don't know if I know what you're asking, but I'll try anyway. The whole JWT standard is well explained at this link . Essentially, if I understand you

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

Verify JWT token signature without decoding it in PyJWT library

Helen Is it possible to verify JWT token signature without decoding it in PyJWT library? Francesco Pegoraro I don't know if I know what you're asking, but I'll try anyway. The whole JWT standard is well explained at this link . Essentially, if I understand you

Verify JWT token signature without decoding it in PyJWT library

Helen Is it possible to verify JWT token signature without decoding it in PyJWT library? Francesco Pegoraro I don't know if I know what you're asking, but I'll try anyway. The whole JWT standard is well explained at this link . Essentially, if I understand you

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

How to verify striped webhook signature without endpoint secret?

Igor Mytyuk I'm building a "multi-platform" solution where each user can have it's "store" and receive discoveries directly on their striped account. So each user provides public and secret stripe keys when creating a store, which are stored on the server and

Heroku SSL: Install intermediate certificates?

Paul Sanwald My registrar gandi gave me the intermediate certificate to install, so I have 3 files: Private key file (server.key) Certificate file (mycert.crt) Intermediate Certificate (GandiSomething.pem) I am using SSL Beta service on heroku . heroku CLI her

Heroku SSL: Install intermediate certificates?

Paul Sanwald My registrar gandi gave me the intermediate certificate to install, so I have 3 files: Private key file (server.key) Certificate file (mycert.crt) Intermediate Certificate (GandiSomething.pem) I am using SSL Beta service on heroku . heroku CLI her

Nginx does not provide intermediate certificates

User 1094128 I'm trying to install a ssl certificate on Nginx (Laravel Forge actually). I have connected the certificate with intermediate and there are no errors in the Nginx error log. However, it's not trusted in mobile Chrome - desktop only. Looking at the

Exception with signature: Unable to verify signature

Adrian: I have the following code, taken from the PDFBox 2's ShowSignature example. I'm running five tests in which I tested and 4 of them pass without a hitch (no signature, single signature, double signature, expired signature), but the fifth is wit elliptic

Verify Signature ECDSA Signature with Openssl

monkeyUser I want to create a signature and verify it using openssl. I want the hex output of my signature. this is my code #create private key openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -noout -out private.pem #public key derivation openssl e