Expand description
Functions for signing data
Here be crypto-dragons.
SAML is awful, every time I read answer they are almost correct, here is the correct algorithm distilled:
- SHA1 the canonical version of the Assertion.
- Generate a SignedInfo XML fragment with the SHA1 signature
- Sign the SignedInfo XML fragment, again the canonical form
- Take the SignedInfo, the Signature and the key info and create a Signature XML fragment
- Insert this SignatureXML into the Assertion ( should go right before the saml:subject)
- Now take the assertion(with the signature included) and insert it into the Response
- SHA1 this response
- Generate a SignedInfo XML fragment with the SHA1 signature
- Sign the SignedInfo XML fragment, again the canonical form
- Take the SignedInfo, the Signature and the key info and create a Signature XML fragment
- Insert this SignatureXML into the Response
- Add the XML version info to the response.
Thats it. SAML is completely awful. There are tons of little subtleties that make implementing SAML a nightmare(like calculating the canonical form of a subset of the XML(the assertion), also the XML version of XML documents is not included.
Enums
Options of Digest Algorithms for things
Options of Signing Algorithms for things
Functions
Loads a PEM-encoded public key into a PKey object
Loads a public cert from a PEM file into an X509 object
Sign some data, with a key