Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl and Encrypted SAML Token

by GrandFather (Saint)
on Jul 22, 2015 at 10:07 UTC ( [id://1135825]=note: print w/replies, xml ) Need Help??


in reply to Perl and Encrypted SAML Token

I went to run your script which at first glance looks like a reasonably stripped down test script, but then realised I needed a private key file which wasn't provided. It would make the "sample" code easier to use it it embedded a private key or generated a private key file.

At a first glance the output string you show suggests some encoding/decoding (not encryption/decryption) issue.

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^2: Perl and Encrypted SAML Token
by SquirrelHead (Initiate) on Jul 22, 2015 at 14:13 UTC

    Hello

    Thank you for taking the time to reply to me. I'm guessing I shouldn't upload the original private key file here so will explaining the commands that I used to create the key file suffice or do I need to create a separate file in order to test. I'm listing the commands first as I am starting to wonder if I have done something wrong in the creation of the certificate.

    On Linux I ran the following command.

    openssl genrsa -des3 -out private_key.pem 2048

    I selected a passphrase and this is the same string that goes into the code above in the $password string.

    I then created the self signed certificate with the next command.

    openssl req -new -x509 -key private_key.pem -out private_cert.pem -days 9125

    At this point I entered details for the certificate DN information.

    Finally, I created the public certificate from the private certificate.

    openssl x509 -inform PEM -in private_cert.pem -outform DER -out public.cer

    The resultant public.cer certificate is what we passed to the third party and they are using this file as the basis of the encryption for teh SAML token that is sent to us.

    If the above looks to be correct then I'll create a test private key and look to add the value to the code.

    Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1135825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-24 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found