https://docs.webfaction.com/xmlrpc-api/apiref.html#method-update_certificate
@param $name
@param $certificate
@param $privateKey
@param $intermediates
@return mixed
@throws WebFactionException
546953
public function updateCertificate($name, $certificate, $privateKey, $intermediates)
    {
        $this->notAvailableInVersions(1);

        return $this->send('update_certificate', $name, $certificate, $privateKey, $intermediates);
    }
226037
public function addPrivateKey(PrivateKeyInterface $privateKey)
    {
        $pubKeyHex = $privateKey->getPublicKey()->getHex();
        $this->privateKeys[$pubKeyHex] = $privateKey;
    }
575253
def sync_certificates(self, subdomains=None):
        
        result = run(".acme.sh/acme.sh --list", quiet=True)
        logger.info("Syncing Webfaction certificates")
        for acme_certificate_description in result.split('\n')[1:]:
            main_domain = acme_certificate_description.split()[0]
            if subdomains and main_domain not in subdomains:
                continue
            if exists(os.path.join("~/.acme.sh/", main_domain)):
                certificate_cer = self.get_remote_content(
                    os.path.join("~/.acme.sh/", main_domain, main_domain + ".cer")
                )
                certificate_key = self.get_remote_content(
                    os.path.join("~/.acme.sh/", main_domain, main_domain + ".key")
                )
                certificate_ca = self.get_remote_content(
                    os.path.join("~/.acme.sh/", main_domain, "ca.cer")
                )
                certificate_name = self.slugify(main_domain)

                certificate = self._certificates.get(certificate_name)
                if (certificate is None
                    or certificate['certificate'] != certificate_cer
                    or certificate['private_key'] != certificate_key
                    or certificate['intermediates'] != certificate_ca):
                    new_certificate = dict(
                        name=certificate_name,
                        certificate=certificate_cer,
                        private_key=certificate_key,
                        intermediates=certificate_ca,
                    )
                    if certificate is None:
                        logger.info("Creating new certificate for %s" % main_domain)
                        self.api.create_certificate(new_certificate)
                    else:
                        logger.info("Updating certificate for %s" % main_domain)
                        self.api.update_certificate(new_certificate)
                    self._certificates[certificate_name] = new_certificate
1115432
def update(gandi, resource, ssl, private_key, poll_cert):
    
    gandi.hostedcert.activate_ssl(resource, ssl, private_key, poll_cert)
878802
public function cc($addresses, $name = null) {
        $this->message->setCc($addresses, $name);
        return $this;
    }
1127642
public function addOwningOneToOne($name, $targetEntity, $inversedBy = null)
    {
        $builder = $this->createOneToOne($name, $targetEntity);

        if ($inversedBy) {
            $builder->inversedBy($inversedBy);
        }

        return $builder->build();
    }
850085
private function _checkKeyUsage(Certificate $cert)
    {
        $extensions = $cert->tbsCertificate()->extensions();
        if ($extensions->hasKeyUsage()) {
            $ext = $extensions->keyUsage();
            if (!$ext->isKeyCertSign()) {
                throw new PathValidationException("keyCertSign usage not set.");
            }
        }
    }
344207
public function create($name, $privateKey, $leafCertificate, $certificateChain)
    {
        $data = [
            'name' => $name,
            'private_key' => $privateKey,
            'leaf_certificate' => $leafCertificate,
            'certificate_chain' => $certificateChain,
        ];

        $certificate = $this->adapter->post(sprintf('%s/certificates', $this->endpoint), $data);

        $certificate = json_decode($certificate);

        return new CertificateEntity($certificate->certificate);
    }
351351
public static void verifyAndThrow(final String name, final X509Certificate cert) throws CertificateException{
		if (!verify(name, cert)) {
			throw new CertificateException("No name matching " + name + " found");
		}		
	}
565525
public function update($id, $name)
    {
        $image = $this->adapter->put(sprintf('%s/images/%d', $this->endpoint, $id), ['name' => $name]);

        $image = json_decode($image);

        return new ImageEntity($image->image);
    }
1338148
public static function fromPKC(Certificate $cert): IssuerSerial
    {
        $tbsCert = $cert->tbsCertificate();
        $issuer = new GeneralNames(new DirectoryName($tbsCert->issuer()));
        $serial = $tbsCert->serialNumber();
        $uid = $tbsCert->hasIssuerUniqueID() ? $tbsCert->issuerUniqueID() : null;
        return new self($issuer, $serial, $uid);
    }
205324
private void updateState(X509Certificate currCert)
        throws CertPathValidatorException
    {
        PublicKey cKey = currCert.getPublicKey();
        if (debug != null) {
            debug.println("BasicChecker.updateState issuer: " +
                currCert.getIssuerX500Principal().toString() + "; subject: " +
                currCert.getSubjectX500Principal() + "; serial#: " +
                currCert.getSerialNumber().toString());
        }
        if (PKIX.isDSAPublicKeyWithoutParams(cKey)) {
            // cKey needs to inherit DSA parameters from prev key
            cKey = makeInheritedParamsKey(cKey, prevPubKey);
            if (debug != null) debug.println("BasicChecker.updateState Made " +
                                             "key with inherited params");
        }
        prevPubKey = cKey;
        prevSubject = currCert.getSubjectX500Principal();
    }
480482
public function addCertificate($roleName, RemoteDesktopCertificate $certificate)
    {
        $namespaceUri = $this->dom->lookupNamespaceUri($this->dom->namespaceURI);
        $xpath = new \DOMXpath($this->dom);
        $xpath->registerNamespace('sc', $namespaceUri);

        $xpathExpression = '//sc:Role[@name="' . $roleName . '"]//sc:Certificates';
        $certificateList = $xpath->evaluate($xpathExpression);

        if ($certificateList->length == 1) {
            $certificatesNode = $certificateList->item(0);
            $certificateNodeToDelete = null;
            foreach ($certificatesNode->childNodes as $certificateNode) {
                if (!$certificateNode instanceof \DOMElement) {
                    continue;
                }

                if ('Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption' == $certificateNode->getAttribute('name')) {
                    $certificateNodeToDelete = $certificateNode;
                }
            }
            if (!is_null($certificateNodeToDelete)) {
                $certificatesNode->removeChild($certificateNodeToDelete);
            }
        } else {
            $certificatesNode = $this->dom->createElementNS($namespaceUri, 'Certificates');

            $roleNodeList = $xpath->evaluate('//sc:Role[@name="' . $roleName . '"]');

            if ($roleNodeList->length == 0) {
                throw new \RuntimeException("No Role found with name '" . $roleName . "'.");
            }

            $roleNode = $roleNodeList->item(0);
            $roleNode->appendChild($certificatesNode);
        }

        $certificateNode = $this->dom->createElementNS($namespaceUri, 'Certificate');
        $certificateNode->setAttribute('name', 'Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption');
        $certificateNode->setAttribute('thumbprint', $certificate->getThumbprint());
        $certificateNode->setAttribute('thumbprintAlgorithm', 'sha1');

        $certificatesNode->appendChild($certificateNode);

        $this->save();
    }
600326
public function signedRoute($name, $parameters = [], $expiration = null, $absolute = true)
    {
        $parameters = $this->formatParameters($parameters);

        if ($expiration) {
            $parameters = $parameters + ['expires' => $this->availableAt($expiration)];
        }

        ksort($parameters);

        $key = call_user_func($this->keyResolver);

        return $this->route($name, $parameters + [
            'signature' => hash_hmac('sha256', $this->route($name, $parameters, $absolute), $key),
        ], $absolute);
    }
585050
public function signature ( $request, $base_string, $consumer_secret, $token_secret )
	{
		// Fetch the private key cert based on the request
		$cert = $this->fetch_private_cert($request);
		
		// Pull the private key ID from the certificate
		$privatekeyid = openssl_get_privatekey($cert);
		
		// Sign using the key
		$sig = false;
		$ok  = openssl_sign($base_string, $sig, $privatekeyid);   
		
		// Release the key resource
		openssl_free_key($privatekeyid);
		  
		return $request->urlencode(base64_encode($sig));
	}
749733
protected static function getNormalizedHeaderKey(string $name){
        static $convertCache = [];

        if(!isset($convertCache[$name])){
            $convertCache[$name]    = ucfirst(ucwords($name, "-"));
        }

        return $convertCache[$name];
    }
1003790
private function bakeEntity(string $name) : void
    {
        $this->pathFragment = 'Model/Entity/';

        $this->bake($this->_entityName($name), 'Model/entity', ['name' => $this->_entityName($name)]);
    }