All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.est.ESTRequest Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for CMS, PKCS, EAC, TSP, CMP, CRMF, OCSP, and certificate generation. The APIs are designed primarily to be used in conjunction with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified.

There is a newer version: 2.0.7
Show newest version
package org.bouncycastle.est;

import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import java.util.Map;

/**
 * Implements a basic http request.
 */
public class ESTRequest
{
    final String method;
    final URL url;
    HttpUtil.Headers headers = new HttpUtil.Headers();
    final byte[] data;
    final ESTHijacker hijacker;
    final ESTClient estClient;
    final ESTSourceConnectionListener listener;

    ESTRequest(
        String method,
        URL url,
        byte[] data,
        ESTHijacker hijacker,
        ESTSourceConnectionListener listener,
        HttpUtil.Headers headers,
        ESTClient estClient)
    {
        this.method = method;
        this.url = url;
        this.data = data;
        this.hijacker = hijacker;
        this.listener = listener;
        this.headers = headers;
        this.estClient = estClient;
    }

    public String getMethod()
    {
        return method;
    }

    public URL getURL()
    {
        return url;
    }

    public Map getHeaders()
    {
        return (Map)headers.clone();
    }

    public ESTHijacker getHijacker()
    {
        return hijacker;
    }

    public ESTClient getClient()
    {
        return estClient;
    }

    public ESTSourceConnectionListener getListener()
    {
        return listener;
    }

    public void writeData(OutputStream os)
        throws IOException
    {
        if (data != null)
        {
            os.write(data);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy