Layer7 Access Management

Tech Tip - CA Single Sign-On: Exception thrown while exporting metadata using smfedexport tool

By wonsa03 posted 06-10-2016 02:19 AM


CA Single Sign-On Tech Tip by Sau Lai Wong, Senior Support Engineer for 10th June 2016



Exception is returned while executing the following smfedexport command:


smfedexport -type saml2idp -expiredays 0 -username ***** -password **** -sign -pubkey


Exception returned:

An exception occurred while signing metadata

Caught an Exception calling signXMLDocument using IXMLSignature. nulljava.lang.NullPointerException

at com.netegrity.smkeydatabase.api.XMLDocumentOpsImpl.signXMLDocument(

at com.netegrity.SAML2Security.DSigSigner.signSAMLEnveloped(





There is no exception if they execute the command without the -sign option.


Upon inspecting the list of certificates under SmKeyDatabase, the "defaultenterpriseprivatekey" entry is associate with  "CertificateEntry" type instead of "KeyEntry".



  1. Delete the existing "defaultenterpriseprivatekey" from the Smkeydatabase.

  2. Then convert the private key from PEM(text) file to DER(binary) format with following command:

    openssl pkcs8 -topk8 -inform PEM -outform DER -in <PEM private key file> -out <DER private key file>

  3. Ensure that the public certificate file is in PEM(text) and BASE64 encoded.

  4. Add the cert/key pair with the following command:

    smkeytool.bat -addPrivKey -alias defaultenterpriseprivatekey -keyfile "c:\siteminder\certs\post-pkey.der" -certfile "c:\siteminder\certs\post-cert.crt" -password password



The first part of the command references the private key (in DER format). The second part of the command references the public certificate, followed by the password associated with the private key.

1 view