/** * @param ObjectIdentifier|string $objIdentifier * @param \FG\ASN1\Object $value */ public function __construct($objIdentifier, Object $value) { if ($objIdentifier instanceof ObjectIdentifier == false) { $objIdentifier = new ObjectIdentifier($objIdentifier); } parent::__construct($objIdentifier, $value); }
/** * @param string $commonName * @param string $email * @param string $organization * @param string $locality * @param string $state * @param string $country * @param string $organizationalUnit */ public function __construct($commonName, $email, $organization, $locality, $state, $country, $organizationalUnit) { parent::__construct(new RDNString(OID::COUNTRY_NAME, $country), new RDNString(OID::STATE_OR_PROVINCE_NAME, $state), new RDNString(OID::LOCALITY_NAME, $locality), new RDNString(OID::ORGANIZATION_NAME, $organization), new RDNString(OID::OU_NAME, $organizationalUnit), new RDNString(OID::COMMON_NAME, $commonName), new RDNString(OID::PKCS9_EMAIL, $email)); $this->commonName = $commonName; $this->email = $email; $this->organization = $organization; $this->locality = $locality; $this->state = $state; $this->country = $country; $this->organizationalUnit = $organizationalUnit; }
/** * @param \Jose\JWKInterface|string|array $data */ public function __construct($data) { parent::__construct(); if ($data instanceof JWKInterface) { $this->loadJWK($data->getValues()); } elseif (is_array($data)) { $this->loadJWK($data); } elseif (is_string($data)) { $this->loadPEM($data); } else { throw new \InvalidArgumentException('Unsupported input'); } }
/** * @param string $hexKey * @param \FG\ASN1\Object|string $algorithmIdentifierString */ public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) { parent::__construct(new Sequence(new ObjectIdentifier($algorithmIdentifierString), new NullObject()), new BitString($hexKey)); }