Search in sources :

Example 1 with CouldNotParseRevokeReasonException

use of com.venafi.vcert.sdk.connectors.ConnectorException.CouldNotParseRevokeReasonException in project vcert-java by Venafi.

the class TppConnector method revokeCertificate.

@Override
public void revokeCertificate(RevocationRequest request) throws VCertException {
    Integer reason = revocationReasons.get(request.reason());
    if (reason == null)
        throw new CouldNotParseRevokeReasonException(request.reason());
    CertificateRevokeRequest revokeRequest = new CertificateRevokeRequest().certificateDN(request.certificateDN()).thumbprint(request.thumbprint()).reason(reason).comments(request.comments()).disable(request.disable());
    Tpp.CertificateRevokeResponse revokeResponse = revokeCertificate(revokeRequest);
    if (!revokeResponse.success())
        throw new RevokeFailureException(revokeResponse.error());
}
Also used : CertificateRevokeResponse(com.venafi.vcert.sdk.connectors.tpp.Tpp.CertificateRevokeResponse) RevokeFailureException(com.venafi.vcert.sdk.connectors.ConnectorException.RevokeFailureException) CouldNotParseRevokeReasonException(com.venafi.vcert.sdk.connectors.ConnectorException.CouldNotParseRevokeReasonException)

Aggregations

CouldNotParseRevokeReasonException (com.venafi.vcert.sdk.connectors.ConnectorException.CouldNotParseRevokeReasonException)1 RevokeFailureException (com.venafi.vcert.sdk.connectors.ConnectorException.RevokeFailureException)1 CertificateRevokeResponse (com.venafi.vcert.sdk.connectors.tpp.Tpp.CertificateRevokeResponse)1