Skip to content
Snippets Groups Projects
Commit 7b558e90 authored by Dan Tsosie's avatar Dan Tsosie
Browse files

Add support for signature.privatekey for saml-sp-remote

parent a0b636d8
No related branches found
No related tags found
No related merge requests found
......@@ -249,6 +249,14 @@ The following SAML 2.0 options are available:
* `http://www.w3.org/2001/04/xmldsig-more#rsa-sha384`
* `http://www.w3.org/2001/04/xmldsig-more#rsa-sha512`
`signature.privatekey`
: Name of private key file for this IdP, in PEM format. The filename is relative to the cert/-directory.
: Note that this option also exists in the IdP-hosted metadata. This entry in the SP-remote metadata overrides the option `privatekey` in the IdP-hosted metadata.
`signature.privatekey_pass`
: Passphrase for the private key. Leave this option out if the private key is unencrypted.
: Note that this option only is used if `signature.privatekey` is present.
`simplesaml.nameidattribute`
: When the value of the `NameIDFormat`-option is set to either
`email` or `persistent`, this is the name of the attribute which
......
......@@ -18,8 +18,16 @@ class sspmod_saml_Message {
*/
public static function addSign(SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, SAML2_SignedElement $element) {
$keyArray = SimpleSAML_Utilities::loadPrivateKey($srcMetadata, TRUE);
$certArray = SimpleSAML_Utilities::loadPublicKey($srcMetadata, FALSE);
$dstPrivateKey = $dstMetadata->getString('signature.privatekey', NULL);
if($dstPrivateKey !== NULL) {
$keyArray = SimpleSAML_Utilities::loadPrivateKey($dstMetadata, TRUE, 'signature.');
$certArray = SimpleSAML_Utilities::loadPublicKey($dstMetadata, FALSE, 'signature.');
}
else {
$keyArray = SimpleSAML_Utilities::loadPrivateKey($srcMetadata, TRUE);
$certArray = SimpleSAML_Utilities::loadPublicKey($srcMetadata, FALSE);
}
$algo = $dstMetadata->getString('signature.algorithm', NULL);
if ($algo === NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment