From 3fefbc94b3dc2508182ef9f11de1a815a40192b4 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 30 Jun 2019 10:41:42 +0100 Subject: [PATCH] utility to decode personas --- core/src/main/groovy/com/muwire/core/Persona.groovy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/groovy/com/muwire/core/Persona.groovy b/core/src/main/groovy/com/muwire/core/Persona.groovy index 5b7ff7ef..17bc10e1 100644 --- a/core/src/main/groovy/com/muwire/core/Persona.groovy +++ b/core/src/main/groovy/com/muwire/core/Persona.groovy @@ -82,4 +82,13 @@ public class Persona { Persona other = (Persona)o name.equals(other.name) && destination.equals(other.destination) } + + public static void main(String []args) { + if (args.length != 1) { + println "This utility decodes a bas64-encoded persona" + System.exit(1) + } + Persona p = new Persona(new ByteArrayInputStream(Base64.decode(args[0]))) + println p.getHumanReadableName() + } }