将 SAML 响应与 RSA 密钥与 IDP 元数据与 x509 进行比较



我正在尝试调试SAML配置。我正在设置 SP,并获得了包含 X509 证书的元数据。我从 IDP 那里得到的 SAMLResponse 有一个 RSAKey。我假设两者的模数应该匹配(以及我无法访问的私钥的模数(。

使用 openssl,我可以得到模数和模量 md5:

$ openssl x509 -in idp.crt -modulus -noout
Modulus=CB123123
$ openssl x509 -in idp.crt -modulus -noout | openssl md5
5a562

x509指数:65537(0x10001(

SAMLResponse 具有模数和指数

        <KeyValue>
            <RSAKeyValue>
                <Modulus>
                    wb3JBTztiDtGQ
                </Modulus>
                <Exponent>ABC</Exponent>
            </RSAKeyValue>
        </KeyValue>

如何确认 x509 证书模数是否与 RSA 模数匹配/SAMLResponse 模数的格式是什么?

我最终找到了一种方法。

$ openssl x509 -in cert.crt -modulus -noout
Modulus=c1b2e3
$ echo wb3JBTztiDtGQ | base64 -d | od -t x1
c1 b2 e3

最新更新