From f999da3a4d1d314840664b3d4a671c4b72a8595c Mon Sep 17 00:00:00 2001 From: Patrick Kuo Date: Thu, 16 Feb 2017 15:11:25 +0000 Subject: [PATCH] Addressed PR issues --- .../doorman/persistence/JiraCertificateRequestStorage.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt b/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt index 4d3ee9c511..b7366f9b24 100644 --- a/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt +++ b/doorman/src/main/kotlin/com/r3/corda/doorman/persistence/JiraCertificateRequestStorage.kt @@ -36,7 +36,9 @@ class JiraCertificateRequestStorage(val delegate: CertificationRequestStorage, val response = getResponse(requestId) if (response !is CertificateResponse.Unauthorised) { val request = StringWriter() - JcaPEMWriter(request).writeObject(PemObject("CERTIFICATE REQUEST", certificationData.request.encoded)) + JcaPEMWriter(request).use{ + it.writeObject(PemObject("CERTIFICATE REQUEST", certificationData.request.encoded)) + } val commonName = certificationData.request.subject.commonName val email = certificationData.request.subject.getRDNs(BCStyle.EmailAddress).firstOrNull()?.first?.value val nearestCity = certificationData.request.subject.getRDNs(BCStyle.L).firstOrNull()?.first?.value