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

org.jscep.transport.request.GetCaCertRequest Maven / Gradle / Ivy

There is a newer version: 2.5.6
Show newest version
package org.jscep.transport.request;

/**
 * This class represents a GetCACert request.
 */
public final class GetCaCertRequest extends Request {
    private final String profile;

    /**
     * Creates a new GetCaCertRequest with the given CA profile.
     * 
     * @param profile
     *            the CA profile to use.
     */
    public GetCaCertRequest(final String profile) {
        super(Operation.GET_CA_CERT);

        this.profile = profile;
    }

    /**
     * Creates a new GetCaCertRequest without a CA profile.
     */
    public GetCaCertRequest() {
        this(null);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getMessage() {
        if (profile == null) {
            return "";
        }
        return profile;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        if (profile != null) {
            return "GetCACert(" + profile + ")";
        } else {
            return "GetCACert";
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy