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

eu.europa.esig.dss.x509.ocsp.OCSPRespStatus Maven / Gradle / Ivy

Go to download

DSS Service Provider Interface contains the contract interface shared between the applet and the server-side of DSS.

There is a newer version: 6.0.d4j.2
Show newest version
package eu.europa.esig.dss.x509.ocsp;

import org.bouncycastle.cert.ocsp.OCSPResp;

/**
 * This enum encapsulates constants defined by BouncyCastle and offers a method to parse an int without exception
 *
 */
public enum OCSPRespStatus {

	/** Response has valid confirmations */
	SUCCESSFUL(OCSPResp.SUCCESSFUL),

	/** Illegal confirmation request */
	MALFORMED_REQUEST(OCSPResp.MALFORMED_REQUEST),

	/** Internal error in issuer */
	INTERNAL_ERROR(OCSPResp.INTERNAL_ERROR),

	/** Try again later */
	TRY_LATER(OCSPResp.TRY_LATER),

	/** (4) is not used */
	UNKNOWN_STATUS(4),

	/** Must sign the request */
	SIG_REQUIRED(OCSPResp.SIG_REQUIRED),

	/** Request unauthorized */
	UNAUTHORIZED(OCSPResp.UNAUTHORIZED);

	private final int statusCode;

	private OCSPRespStatus(int statusCode) {
		this.statusCode = statusCode;
	}

	public static OCSPRespStatus fromInt(int value) {
		for (OCSPRespStatus status : OCSPRespStatus.values()) {
			if (status.statusCode == value) {
				return status;
			}
		}
		return OCSPRespStatus.UNKNOWN_STATUS;
	}

	public int getStatusCode() {
		return statusCode;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy