コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
ファイル: CertificateSubject.php プロジェクト: afk11/phpasn1
 /**
  * @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;
 }
コード例 #3
0
ファイル: ECKey.php プロジェクト: rwx-zwx-awx/jose
 /**
  * @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');
     }
 }
コード例 #4
0
ファイル: PrivateKey.php プロジェクト: afk11/phpasn1
 /**
  * @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));
 }