You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
615 B
PHTML

5 years ago
<?php
namespace Cijber\OpenSSL\Stack;
use Cijber\OpenSSL\Stack;
use Cijber\OpenSSL\X509;
use FFI;
use FFI\CData;
class X509Stack extends Stack
{
const CLASSNAME = X509::class;
5 years ago
public static function from(FFI $ffi, CData $cObj, $owner = null): X509Stack
5 years ago
{
5 years ago
return new X509Stack($ffi, $cObj, $owner = null);
5 years ago
}
public function spawn(CData $cData): X509
{
5 years ago
$obj = $this->ffi->cast(X509::TYPE, $cData);
$clone = $this->ffi->X509_dup($obj);
if ($clone === null) {
return X509::new();
}
return X509::cast($this->ffi, $clone);
5 years ago
}
}