0

I can use some help.

I've got some very sketchy requirements to build Single Sign On to 3rd party website.

The documentation I have says that I need to :

Create an X509 Certificate Public Key Send a SAML post with some basic info to a specific URL

Use plain ( ASCII/UTF8 ) text

In the sample SAML assertion, the X509 certificate is supposed to look like this :

 .....
 <ds:KeyInfo>
    <ds:X509Data>
        <ds:X509Certificate>xxxxxxxxxxxxxxxx</ds:X509Certificate>
     </ds:X509Data>
     <ds:KeyValue>
        <ds:RSAKeyValue>
           <ds:Modulus>xxxxxxxxxxxxxxxx</ds:Modulus>
           <ds:Exponent>xxxx</ds:Exponent>
        </ds:RSAKeyValue>
      </ds:KeyValue>
 ...

So I've created my self-signed certificate, and if I use the command

openssl x509 -noout -text -in ca.crt

I see the public key, but it's got 8 line breaks in it and looks something like this :

 Subject Public Key Info:
      Public Key Algorithm: rsaEncryption
           RSA Public Key: (1024 bit)
             Modulus (1024 bit):
                01:a6:26:44:13:cb:ab:5d:37:83:b4:9f:25:a4:8f:
                73:b8:e3:8c:a6:8a:58:13:a8:4f:af:43:8f:13:4a:
                96:75:63:ba:8d:6a:43:9c:31:... etc

How can I use the public key in my Java servlet, running on tomcat, on RedHat linux. And how is it going to work inside and XML document ?

Or have I taken a wrong turn somewhere ?

Thanks for your help

4

1 回答 1

1

我通常使用类似的东西:

<KeyDescriptor use="signing">
            <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <ds:X509Data>
                    <ds:X509Certificate>    ...hRWRV+DyfQc9nO
                    </ds:X509Certificate>
                </ds:X509Data>
            </ds:KeyInfo>
        </KeyDescriptor>

换句话说,将 "01:a6:26:44:13:" 转换为 "01a6264413" 而没有换行符。

于 2013-02-17T21:28:41.230 回答