12 parent::__construct($service);
23 if (isset($options[
"filter"]) && intval($options[
"filter"])) {
24 $filter=intval($options[
"filter"]);
28 $ssllist=$this->ssl->get_list($filter);
39 if (!isset($options[
"fqdn"]) || !is_string($options[
"fqdn"])) {
40 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: FQDN") );
42 $certid=$this->ssl->new_csr($options[
"fqdn"]);
43 if ($certid===
false) {
56 if (!isset($options[
"id"]) || !intval($options[
"id"])) {
57 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: ID") );
59 $certinfo=$this->ssl->get_certificate(intval($options[
"id"]));
60 if ($certinfo===
false) {
74 if (!isset($options[
"id"]) || !intval($options[
"id"])) {
75 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: ID") );
77 if (!isset($options[
"action"]) ) {
78 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: ACTION") );
80 $isok=$this->ssl->share(intval($options[
"id"]), (intval($options[
"action"]))?
true :
false );
94 if (!isset($options[
"key"]) || !is_string($options[
"key"])) {
95 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: KEY") );
97 if (!isset($options[
"crt"]) || !is_string($options[
"crt"])) {
98 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: CRT") );
100 if (isset($options[
"chain"])) {
101 if (!is_string($options[
"chain"])) {
102 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Invalid argument: CHAIN") );
105 $options[
"chain"]=
"";
108 $certid=$this->ssl->import_cert($options[
"key"],$options[
"crt"],$options[
"chain"]);
109 if ($certid===
false) {
125 if (!isset($options[
"id"]) || !intval($options[
"id"])) {
126 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: ID") );
128 if (!isset($options[
"crt"]) || !is_string($options[
"crt"])) {
129 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: CRT") );
131 if (isset($options[
"chain"])) {
132 if (!is_string($options[
"chain"])) {
133 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Invalid argument: CHAIN") );
136 $options[
"chain"]=
"";
139 $certid=$this->ssl->finalize(intval($options[
"id"]),$options[
"crt"],$options[
"chain"]);
140 if ($certid===
false) {
153 if (!isset($options[
"name"]) || !is_string($options[
"name"])) {
154 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: NAME") );
156 if (!isset($options[
"content"]) || !is_string($options[
"content"])) {
157 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: CONTENT") );
160 $isok=$this->ssl->alias_add($options[
"name"],$options[
"content"]);
174 if (!isset($options[
"name"]) || !is_string($options[
"name"])) {
175 return new Alternc_Api_Response( array(
"code" => self::ERR_INVALID_ARGUMENT,
"message" =>
"Missing or invalid argument: NAME") );
178 $isok=$this->ssl->alias_del($options[
"name"]);
Any Legacy AlternC Api should use this class as a parent to be able to handle properly the access rig...
alterncLegacyErrorManager()
return a proper Alternc_Api_Response from an error class and error string from AlternC legacy class
SSL Api of AlternC, used by alternc-api package.
share($options)
API Method from legacy class share()
aliasAdd($options)
API Method from legacy class alias_add()
getCertificate($options)
API Method from legacy class get_certificate()
importCert($options)
API Method from legacy class import_cert()
newCsr($options)
API Method from legacy class new_csr()
getList($options)
API Method from legacy class get_list()
aliasDel($options)
API Method from legacy class alias_del()
finalize($options)
API Method from legacy class finalize()
Standard Response object for the AlternC API.