diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2016-07-30 00:23:48 +0200 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2016-07-30 00:27:44 +0200 |
| commit | e46fdb07d014368bb506b02d4ca9fafda672800a (patch) | |
| tree | 2b06378aa36fc2e5af66453848b71d554e9aad76 /base/common/src | |
| parent | 7cfff9fb0c08d08f57d6229cb8a67d7c94f785aa (diff) | |
| download | pki-e46fdb07d014368bb506b02d4ca9fafda672800a.tar.gz pki-e46fdb07d014368bb506b02d4ca9fafda672800a.tar.xz pki-e46fdb07d014368bb506b02d4ca9fafda672800a.zip | |
Added log message in PKIClient.
To help troubleshooting the PKIClient class has been modified to
log the certificate chain retrieved from the CA.
https://fedorahosted.org/pki/ticket/2399
Diffstat (limited to 'base/common/src')
| -rw-r--r-- | base/common/src/com/netscape/certsrv/client/PKIClient.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/base/common/src/com/netscape/certsrv/client/PKIClient.java b/base/common/src/com/netscape/certsrv/client/PKIClient.java index 5c13554fe..8cad382da 100644 --- a/base/common/src/com/netscape/certsrv/client/PKIClient.java +++ b/base/common/src/com/netscape/certsrv/client/PKIClient.java @@ -32,6 +32,7 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import org.apache.commons.codec.binary.Base64; import org.mozilla.jss.CryptoManager; import org.mozilla.jss.CryptoManager.NicknameConflictException; import org.mozilla.jss.CryptoManager.NotInitializedException; @@ -177,7 +178,15 @@ public class PKIClient { Element element = (Element)list.item(0); String encodedChain = element.getTextContent(); - return Utils.base64decode(encodedChain); + byte[] bytes = Utils.base64decode(encodedChain); + + if (verbose) { + System.out.println("-----BEGIN PKCS7-----"); + System.out.print(new Base64(64).encodeToString(bytes)); + System.out.println("-----END PKCS7-----"); + } + + return bytes; } public X509Certificate importCertPackage(byte[] bytes, String nickname) |
