@Test public void unmarshalLocked() { final KeyDataConfig result = JaxbUtil.unmarshal(getClass().getResourceAsStream("/lockedprivatekey.json"), KeyDataConfig.class); assertThat(result).isNotNull(); assertThat(result.getType()).isEqualTo(PrivateKeyType.LOCKED); assertThat(result.getPrivateKeyData()).isNotNull(); assertThat(result.getSnonce()).isEqualTo("x3HUNXH6LQldKtEv3q0h0hR4S12Ur9pC"); assertThat(result.getAsalt()).isEqualTo("7Sem2tc6fjEfW3yYUDN/kSslKEW0e1zqKnBCWbZu2Zw="); assertThat(result.getSbox()).isEqualTo("d0CmRus0rP0bdc7P7d/wnOyEW14pwFJmcLbdu2W3HmDNRWVJtoNpHrauA/Sr5Vxc"); assertThat(result.getArgonOptions()).isNotNull(); assertThat(result.getArgonOptions().getAlgorithm()).isEqualTo("id"); assertThat(result.getArgonOptions().getIterations()).isEqualTo(10); assertThat(result.getArgonOptions().getParallelism()).isEqualTo(4); assertThat(result.getArgonOptions().getMemory()).isEqualTo(1048576); }
public static <T> T unmarshal(InputStream inputStream, Class<T> type) { try { return UnmarshallerBuilder.create().build().unmarshal(new StreamSource(inputStream), type).getValue(); } catch (JAXBException ex) { throw new ConfigException(ex); } }
JaxbUtil { public static <T> T unmarshal(InputStream inputStream, Class<T> type) { try { return UnmarshallerBuilder.create().build().unmarshal(new StreamSource(inputStream), type).getValue(); } catch (JAXBException ex) { throw new ConfigException(ex); } } }
JaxbUtil { public static <T> T unmarshal(InputStream inputStream, Class<T> type) { try { return UnmarshallerBuilder.create().build().unmarshal(new StreamSource(inputStream), type).getValue(); } catch (JAXBException ex) { throw new ConfigException(ex); } } private  JaxbUtil(); }
JaxbUtil { public static <T> T unmarshal(InputStream inputStream, Class<T> type) { try { return UnmarshallerBuilder.create().build().unmarshal(new StreamSource(inputStream), type).getValue(); } catch (JAXBException ex) { throw new ConfigException(ex); } } private  JaxbUtil(); static T unmarshal(InputStream inputStream, Class<T> type); static void marshal(Object object, OutputStream outputStream); static void marshalWithNoValidation(Object object, OutputStream outputStream); static String marshalToString(Object object); static String marshalToStringNoValidation(Object object); static void marshalMasked(Config object, OutputStream outputStream); }
JaxbUtil { public static <T> T unmarshal(InputStream inputStream, Class<T> type) { try { return UnmarshallerBuilder.create().build().unmarshal(new StreamSource(inputStream), type).getValue(); } catch (JAXBException ex) { throw new ConfigException(ex); } } private  JaxbUtil(); static T unmarshal(InputStream inputStream, Class<T> type); static void marshal(Object object, OutputStream outputStream); static void marshalWithNoValidation(Object object, OutputStream outputStream); static String marshalToString(Object object); static String marshalToStringNoValidation(Object object); static void marshalMasked(Config object, OutputStream outputStream); static final Class[] JAXB_CLASSES; }