lib/AcmeService.php
public function revokeCertificate(string $pem): Promise {
        return call(function () use ($pem) {
            $begin = 'CERTIFICATE-----';
            $end = '----END';

            $pem = substr($pem, strpos($pem, $begin) + strlen($begin));
            $pem = substr($pem, 0, strpos($pem, $end));

            $enc = new Base64UrlSafeEncoder;

            /** @var Response $response */
            $response = yield $this->acmeClient->post(AcmeResource::REVOKE_CERTIFICATE, [
                'certificate' => $enc->encode(base64_decode($pem)),
            ]);

            if ($response->getStatus() === 200) {
                return true;
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function revokeCertificate(string $pem): Promise {
        return call(function () use ($pem) {
            $begin = 'CERTIFICATE-----';
            $end = '----END';

            $pem = substr($pem, strpos($pem, $begin) + strlen($begin));
            $pem = substr($pem, 0, strpos($pem, $end));

            $enc = new Base64UrlSafeEncoder;

            /** @var Response $response */
            $response = yield $this->acmeClient->post(AcmeResource::REVOKE_CERTIFICATE, [
                'certificate' => $enc->encode(base64_decode($pem)),
            ]);

            if ($response->getStatus() === 200) {
                return true;
            }

            throw $this->generateException($response, yield $response->getBody());
        });
    }
public function revokeCertificate ( string $ pem ) : Promise { return call ( function ( ) use ( $ pem ) { $ begin = 'CERTIFICATE-----' ; $ end = '----END' ; $ pem = substr ( $ pem , strpos ( $ pem , $ begin ) + strlen ( $ begin ) ) ; $ pem = substr ( $ pem , 0 , strpos ( $ pem , $ end ) ) ; $ enc = new Base64UrlSafeEncoder ; /** @var Response $response */ $ response = yield $ this -> acmeClient -> post ( AcmeResource :: REVOKE_CERTIFICATE , [ 'certificate' => $ enc -> encode ( base64_decode ( $ pem ) ) , ] ) ; if ( $ response -> getStatus ( ) === 200 ) { return true ; } throw $ this -> generateException ( $ response , yield $ response -> getBody ( ) ) ; } ) ; }
Revokes a certificate.

@api

@param string $pem PEM encoded certificate

@return Promise resolves to true
@throws AcmeException If something went wrong.
Revokes a certificate .