From ba1c1edd97e641503c09fac0ba1626b28603688a Mon Sep 17 00:00:00 2001 From: Daniele Ricci Date: Tue, 8 Jul 2014 16:03:38 +0200 Subject: [PATCH] Bridge certificate: set end date to start date if PGP key doesn't expire This will of course need to be checked server-side because it's not a standard way of using expiration information. Signed-off-by: Daniele Ricci --- src/org/kontalk/crypto/X509Bridge.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/kontalk/crypto/X509Bridge.java b/src/org/kontalk/crypto/X509Bridge.java index 18bebfa7e..30bdcd0ad 100644 --- a/src/org/kontalk/crypto/X509Bridge.java +++ b/src/org/kontalk/crypto/X509Bridge.java @@ -204,7 +204,7 @@ public static X509Certificate createCertificate(PGPPublicKeyRing publicKeyRing, * (defaults to current date and time if null) * @param endDate * date until which the certificate will be valid - * (defaults to current date and time if null) * + * (defaults to start date and time if null) * @param subjAltNameURI * URI to be placed in subjectAltName * @return self-signed certificate @@ -242,8 +242,7 @@ private static X509Certificate createCertificate(PublicKey pubKey, } certGenerator.setNotBefore(startDate); if (endDate == null) { - endDate = new Date(startDate.getTime()+(365L*24L*60L*60L*1000L)); - System.out.println("end date is="+ DateFormat.getDateInstance().format(endDate)); + endDate = startDate; } certGenerator.setNotAfter(endDate);