setasign\SetaPDF2\Signer\X509\Extension

KeyUsage Class representing the X509 Key usage extension.

File: /SetaPDF v2/Signer/X509/Extension/KeyUsage.php
Old class name (alias): \SetaPDF_Signer_X509_Extension_KeyUsage

Class hierarchy

Summary

Constants

OID

public const string KeyUsage::OID = '2.5.29.15'

Extension OID.

PURPOSE_CRL_SIGN

public const string KeyUsage::PURPOSE_CRL_SIGN = 2

Purspose OID.

PURPOSE_DATA_ENCIPHERMENT

public const string KeyUsage::PURPOSE_DATA_ENCIPHERMENT = 16

Purspose OID.

PURPOSE_DECIPHER_ONLY

public const string KeyUsage::PURPOSE_DECIPHER_ONLY = 32768

Purspose OID.

PURPOSE_DIGITAL_SIGNATURE

public const string KeyUsage::PURPOSE_DIGITAL_SIGNATURE = 128

Purspose OID.

PURPOSE_ENCIPHER_ONLY

public const string KeyUsage::PURPOSE_ENCIPHER_ONLY = 1

Purspose OID.

PURPOSE_KEY_AGREEMENT

public const string KeyUsage::PURPOSE_KEY_AGREEMENT = 8

Purspose OID.

PURPOSE_KEY_CERT_SIGN

public const string KeyUsage::PURPOSE_KEY_CERT_SIGN = 4

Purspose OID.

PURPOSE_KEY_ENCIPHERMENT

public const string KeyUsage::PURPOSE_KEY_ENCIPHERMENT = 32

Purspose OID.

PURPOSE_NON_REPUDIATION

public const string KeyUsage::PURPOSE_NON_REPUDIATION = 64

Purspose OID.


Properties

$_extension

The extension element.

Extension ::= SEQUENCE { extnID OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING -- contains the DER encoding of an ASN.1 value -- corresponding to the extension type identified -- by extnID }

$_oid

protected string Extension::$_oid

The extension OID.


Static Methods


Methods

__construct()

The constructor.

Parameters
$extension : \SetaPDF_Signer_Asn1_Element
 

getExtensionValue()

Get the extensions value.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

getOid()

public Extension::getOid (
void
): string

Get the OID.

getPurposes()

public KeyUsage::getPurposes (
void
): int

Get the purposes value.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

is()

public KeyUsage::is (
int $purpose
): bool

Checks the purpose by a given OID.

Parameters
$purpose : int
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

isCritical()

public Extension::isCritical (
void
): bool

Get the critical flag.