コード例 #1
0
ファイル: OpenSSLCrypto.php プロジェクト: sop/crypto-util
 /**
  *
  * @see \CryptoUtil\Crypto\Crypto::verify()
  */
 public function verify($data, Signature $signature, PublicKeyInfo $pubkey_info, SignatureAlgorithmIdentifier $algo)
 {
     $this->_checkSignatureAlgoAndKey($algo, $pubkey_info->algorithmIdentifier());
     $result = openssl_verify($data, $signature->octets(), $pubkey_info->toPEM(), $this->_algoToDigest($algo));
     if (-1 == $result) {
         throw new \RuntimeException("openssl_verify() failed: " . $this->_getLastError());
     }
     return 1 == $result ? true : false;
 }
コード例 #2
0
ファイル: AttributeCertificate.php プロジェクト: sop/x509
 /**
  * Get ASN.1 structure.
  *
  * @return Sequence
  */
 public function toASN1()
 {
     return new Sequence($this->_acinfo->toASN1(), $this->_signatureAlgorithm->toASN1(), $this->_signatureValue->toBitString());
 }
コード例 #3
0
ファイル: CertificationRequest.php プロジェクト: sop/x509
 /**
  * Generate ASN.1 structure.
  *
  * @return Sequence
  */
 public function toASN1()
 {
     return new Sequence($this->_certificationRequestInfo->toASN1(), $this->_signatureAlgorithm->toASN1(), $this->_signature->toBitString());
 }