setasign\SetaPDF2\Signer\Cms

SignedData Class representing a CMS signed data container.

File: /SetaPDF v2/Signer/Cms/SignedData.php
Old class name (alias): \SetaPDF_Signer_Cms_SignedData

Class hierarchy

Summary

Static Properties

$usePhpseclibForRsaPss

Flag defining whether usage of phpseclib or default OpenSSL methods for RSA_PSS validation.

$verifyCallback

A callable that can be used to implement individual verification logic.


Properties

$_detachedSignedData

The detached signed data.

$_message

The message object.

$_signedAttributes

All signed attributes. Indexed by their OID.

$_unsignedAttributes

All unsigned attributes. Indexed by their OID.


Methods

__construct()

public SignedData::__construct (
string $message
)

The constructor.

Parameters
$message : string

PEM or DER encoded message.

_getSignedData()

Get SignedData element from the ASN.1 structure.

_getSignerInfo()

Get the SignerInfo element from the ASN.1 structure.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getAsn1()

Get the ASN.1 instance of the SignedData element.

getCertificates()

Get all certificates embedded in the SignedData structure.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

getDigestAlgorithm()

public SignedData::getDigestAlgorithm (
void
): void
Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getDigestAlgorithms()

public SignedData::getDigestAlgorithms (
void
): array

Get the digest algorithms and parameters.

Return Values

An array of arrays where the first value holds the OID of the algorithm. The second value is the ASN.1 structure of the parameters.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getIssuerAndSerialNumber()

public SignedData::getIssuerAndSerialNumber (
void
): array|bool

Get issuer and serial number of the signee.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

getSignatureAlgorithm()

public SignedData::getSignatureAlgorithm (
void
): array
Return Values

The first value holds the OID of the algorithm. The second value is the ASN.1 structure of the parameters.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getSignatureValue()

public SignedData::getSignatureValue (
bool $hex = true
): string
Parameters
$hex : bool
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getSignedAttribute()

public SignedData::getSignedAttribute (
string $oid
): bool|mixed|\SetaPDF_Signer_Asn1_Element

Get a signed attribute by its OID.

Parameters
$oid : string
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getSignedAttributes()

Get all signed attributes.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getSignedData()

getSigningCertificate()

getSubjectKeyIdentifier()

public SignedData::getSubjectKeyIdentifier (
void
): bool|string

Get the subject key identifier.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getUnsignedAttribute()

Get an unsigned attribute by its OID.

Parameters
$oid : string
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getUnsignedAttributes()

Get all unsigned attributes.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

setDetachedSignedData()

public SignedData::setDetachedSignedData (
string|\SetaPDF_Core_Reader_FilePath $detachedSignedData
): void

Set the detached signed data.

Parameters
$detachedSignedData : string|\SetaPDF_Core_Reader_FilePath
 

verify()