From 1086a4a6b9911c7bd9219aaf66493b75bd4901a2 Mon Sep 17 00:00:00 2001 From: foxgem Date: Wed, 30 Jun 2021 15:07:22 +0800 Subject: [PATCH] remove URLEncoder in makeLabeledURI (#146) --- .../attestation/IdentifierAttestation.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alphawallet/attestation/IdentifierAttestation.java b/src/main/java/com/alphawallet/attestation/IdentifierAttestation.java index b1766266..a471e27f 100644 --- a/src/main/java/com/alphawallet/attestation/IdentifierAttestation.java +++ b/src/main/java/com/alphawallet/attestation/IdentifierAttestation.java @@ -156,9 +156,14 @@ public IdentifierAttestation(byte[] derEncoding) throws IOException, IllegalArgu } } - private X500Name makeLabeledURI(String type, String identifier) { - DERUTF8String labelValue = new DERUTF8String(URLEncoder.encode(identifier + " " + type, StandardCharsets.UTF_8)); - RDN rdn = new RDN(LABELED_URI, labelValue); + /** + * @param label the label of the URL, similar to what is inside ... + * @param URL the URL itself, similar to what is in , note that + * it should already be URLencoded therefore not containing space + */ + private X500Name makeLabeledURI(String label, String URL) { + DERUTF8String labeledURLValue = new DERUTF8String(URL + " " + label); + RDN rdn = new RDN(LABELED_URI, labeledURLValue); return new X500Name(new RDN[] {rdn}); }