예제 #1
0
파일: JWE.php 프로젝트: sop/jwx
 /**
  * Convert to compact serialization.
  *
  * @return string
  */
 public function toCompact()
 {
     return Base64::urlEncode($this->_protectedHeader->toJSON()) . "." . Base64::urlEncode($this->_encryptedKey) . "." . Base64::urlEncode($this->_iv) . "." . Base64::urlEncode($this->_ciphertext) . "." . Base64::urlEncode($this->_authenticationTag);
 }
예제 #2
0
파일: JWS.php 프로젝트: sop/jwx
 /**
  * Generate input for the signature computation.
  *
  * @param string $payload Payload
  * @param Header $header Protected header
  * @return string
  */
 protected static function _generateSignatureInput($payload, Header $header)
 {
     $b64 = $header->hasB64Payload() ? $header->B64Payload()->value() : true;
     $data = Base64::urlEncode($header->toJSON()) . ".";
     $data .= $b64 ? Base64::urlEncode($payload) : $payload;
     return $data;
 }