class AuthnRequestFromRelyingPartyUnmarshaller {

    public AuthnRequestFromRelyingParty fromSamlMessage(AuthnRequest authnRequest) {
        final String id = authnRequest.getID();
        final String issuerId = authnRequest.getIssuer().getValue();
        final DateTime issueInstant = authnRequest.getIssueInstant();
        final Boolean forceAuthn = authnRequest.isForceAuthn();
        final Optional<String> assertionConsumerServiceURL = Optional.ofNullable(authnRequest.getAssertionConsumerServiceURL());
        final Integer assertionConsumerServiceIndex = authnRequest.getAssertionConsumerServiceIndex();
        final Signature signature = authnRequest.getSignature();
        final Optional<String> verifyServiceProviderVersion = extractVerifyServiceProviderVersion(authnRequest.getExtensions(), issuerId);

        return new AuthnRequestFromRelyingParty(
            id,
            issuerId,
            issueInstant,
            URI.create(authnRequest.getDestination()),
            Optional.ofNullable(forceAuthn),
            assertionConsumerServiceURL.map(URI::create),
            ofNullable(assertionConsumerServiceIndex),
            ofNullable(signature),
            verifyServiceProviderVersion
        );
    }

    public  AuthnRequestFromRelyingPartyUnmarshaller(Decrypter decrypter);

}