class InstanceSerializer {

    public static InstanceRegistration registrationFromSlime(Slime slime) {
        Cursor root = slime.get();
        return new InstanceRegistration(requireField(PROVIDER_FIELD, root).asString(),
                                        requireField(DOMAIN_FIELD, root).asString(),
                                        requireField(SERVICE_FIELD, root).asString(),
                                        attestationDataToIdentityDocument(StringUtilities.unescape(requireField(ATTESTATION_DATA_FIELD, root).asString())),
                                        Pkcs10CsrUtils.fromPem(requireField(CSR_FIELD, root).asString()));
    }

    private  InstanceSerializer();

}