예제 #1
0
 /**
  * Generate ASN.1 structure.
  *
  * @return Sequence
  */
 public function toASN1()
 {
     return new Sequence($this->_certificationRequestInfo->toASN1(), $this->_signatureAlgorithm->toASN1(), $this->_signature->toBitString());
 }
예제 #2
0
 /**
  * Get ASN.1 structure.
  *
  * @return Sequence
  */
 public function toASN1()
 {
     return new Sequence($this->_acinfo->toASN1(), $this->_signatureAlgorithm->toASN1(), $this->_signatureValue->toBitString());
 }
예제 #3
0
 /**
  * Get OpenSSL digest method for given signature algorithm identifier.
  *
  * @param SignatureAlgorithmIdentifier $algo
  * @throws \UnexpectedValueException
  * @return string
  */
 protected function _algoToDigest(SignatureAlgorithmIdentifier $algo)
 {
     $oid = $algo->oid();
     if (!array_key_exists($oid, self::MAP_DIGEST_OID_TO_NAME)) {
         throw new \UnexpectedValueException("Digest method {$oid} not supported.");
     }
     return self::MAP_DIGEST_OID_TO_NAME[$oid];
 }