/** * Generate ASN.1 structure. * * @return Sequence */ public function toASN1() { $elements = array($this->_issuer->toASN1(), new Integer($this->_serial)); if (isset($this->_issuerUID)) { $elements[] = $this->_issuerUID->toASN1(); } return new Sequence(...$elements); }
/** * * @see \X501\ASN1\AttributeValue\AttributeValue::toASN1() * @return Sequence */ public function toASN1() { $elements = array(); if (isset($this->_roleAuthority)) { $elements[] = new ImplicitlyTaggedType(0, $this->_roleAuthority->toASN1()); } $elements[] = new ExplicitlyTaggedType(1, $this->_roleName->toASN1()); return new Sequence(...$elements); }
/** * * @see \X501\ASN1\AttributeValue\AttributeValue::toASN1() * @return Sequence */ public function toASN1() { $elements = array(); if (isset($this->_policyAuthority)) { $elements[] = new ImplicitlyTaggedType(0, $this->_policyAuthority->toASN1()); } $values = array_map(function (IetfAttrValue $val) { return $val->toASN1(); }, $this->_values); $elements[] = new Sequence(...$values); return new Sequence(...$elements); }
/** * * @see \X509\AttributeCertificate\AttCertIssuer::ASN1() * @return ImplicitlyTaggedType Tagged Sequence */ public function toASN1() { $elements = array(); if (isset($this->_issuerName)) { $elements[] = $this->_issuerName->toASN1(); } if (isset($this->_baseCertificateID)) { $elements[] = new ImplicitlyTaggedType(0, $this->_baseCertificateID->toASN1()); } if (isset($this->_objectDigestInfo)) { $elements[] = new ImplicitlyTaggedType(1, $this->_objectDigestInfo->toASN1()); } return new ImplicitlyTaggedType(0, new Sequence(...$elements)); }
/** * Generate ASN.1 structure. * * @return Sequence */ public function toASN1() { $elements = array(); if (isset($this->_distributionPoint)) { $elements[] = new ExplicitlyTaggedType(0, $this->_distributionPoint->toASN1()); } if (isset($this->_reasons)) { $elements[] = new ImplicitlyTaggedType(1, $this->_reasons->toASN1()); } if (isset($this->_issuer)) { $elements[] = new ImplicitlyTaggedType(2, $this->_issuer->toASN1()); } return new Sequence(...$elements); }
protected function _valueASN1() { $elements = array(); if (isset($this->_keyIdentifier)) { $elements[] = new ImplicitlyTaggedType(0, new OctetString($this->_keyIdentifier)); } // if either issuer or serial is set, both must be set if (isset($this->_authorityCertIssuer) || isset($this->_authorityCertSerialNumber)) { if (!isset($this->_authorityCertIssuer, $this->_authorityCertSerialNumber)) { throw new \LogicException("AuthorityKeyIdentifier must have both" . " authorityCertIssuer and authorityCertSerialNumber" . " present or both absent."); } $elements[] = new ImplicitlyTaggedType(1, $this->_authorityCertIssuer->toASN1()); $elements[] = new ImplicitlyTaggedType(2, new Integer($this->_authorityCertSerialNumber)); } return new Sequence(...$elements); }
protected function _valueASN1() { return $this->_names->toASN1(); }