|
|
20e580 |
From 3dcc932854381d56ce6701082921096848801e1c Mon Sep 17 00:00:00 2001
|
|
|
20e580 |
From: Alexander Scheel <ascheel@redhat.com>
|
|
|
20e580 |
Date: Thu, 23 Apr 2020 16:54:00 -0400
|
|
|
20e580 |
Subject: [PATCH 3/4] Add AlgorithmId.toStringWithParams, fix toString
|
|
|
20e580 |
|
|
|
20e580 |
PKI's usage of AlgorithmId.toString() doesn't handle having the
|
|
|
20e580 |
parameters encoded in the toString() representation of the id.
|
|
|
20e580 |
Move toString() back to only having the contents of algName, and
|
|
|
20e580 |
move parameters to a separate method.
|
|
|
20e580 |
|
|
|
20e580 |
Signed-off-by: Alexander Scheel <ascheel@redhat.com>
|
|
|
20e580 |
---
|
|
|
20e580 |
.../jss/netscape/security/x509/AlgorithmId.java | 12 +++++++++++-
|
|
|
20e580 |
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
20e580 |
|
|
|
20e580 |
diff --git a/org/mozilla/jss/netscape/security/x509/AlgorithmId.java b/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
|
|
|
20e580 |
index ed899fd0..4440fd4d 100644
|
|
|
20e580 |
--- a/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
|
|
|
20e580 |
+++ b/org/mozilla/jss/netscape/security/x509/AlgorithmId.java
|
|
|
20e580 |
@@ -624,9 +624,19 @@ public class AlgorithmId implements Serializable, DerEncoder {
|
|
|
20e580 |
}
|
|
|
20e580 |
|
|
|
20e580 |
/**
|
|
|
20e580 |
- * Returns a string describing the algorithm and its parameters.
|
|
|
20e580 |
+ * Returns a string describing only the algorithm without parameters.
|
|
|
20e580 |
+ *
|
|
|
20e580 |
+ * Use toStringWithParams() for algorithm name and paramaters, or
|
|
|
20e580 |
+ * paramsToString() for just parameters.
|
|
|
20e580 |
*/
|
|
|
20e580 |
public String toString() {
|
|
|
20e580 |
+ return algName();
|
|
|
20e580 |
+ }
|
|
|
20e580 |
+
|
|
|
20e580 |
+ /**
|
|
|
20e580 |
+ * Returns a string describing the algorithm and its parameters.
|
|
|
20e580 |
+ */
|
|
|
20e580 |
+ public String toStringWithParams() {
|
|
|
20e580 |
if (params == null) {
|
|
|
20e580 |
return algName();
|
|
|
20e580 |
}
|
|
|
20e580 |
--
|
|
|
20e580 |
2.26.2
|
|
|
20e580 |
|