CSR
extends Sequence
in package
Class ASNObject is the base class for all concrete ASN.1 objects.
Table of Contents
- CSR_VERSION_NR = 0
- $children : array<string|int, ASNObject>
- $publicKey : mixed
- $signature : mixed
- $signatureAlgorithm : mixed
- $startSequence : mixed
- $subject : mixed
- $contentLength : mixed
- $iteratorPosition : mixed
- $nrOfLengthOctets : mixed
- __construct() : mixed
- __toString() : mixed
- addChild() : mixed
- addChildren() : mixed
- count() : mixed
- current() : mixed
- fromBinary() : ASNObject
- Parse an instance of this class from its binary DER encoded representation.
- getBinary() : string
- Encode this object using DER encoding.
- getChildren() : array<string|int, ASNObject>
- getContent() : mixed
- Return the content of this object in a non encoded form.
- getCountry() : mixed
- getFirstChild() : ASNObject
- getIdentifier() : string
- Returns all identifier octets. If an inheriting class models a tag with the long form identifier format, it MUST reimplement this method to return all octets of the identifier.
- getIterator() : mixed
- getLocalName() : mixed
- getNumberOfChildren() : mixed
- getObjectLength() : mixed
- Returns the length of the whole object (including the identifier and length octets).
- getOrganizationalUnit() : mixed
- getOrganizationName() : mixed
- getPublicKey() : mixed
- getSignature() : mixed
- getSignatureAlgorithm() : mixed
- getSignatureSubject() : mixed
- getState() : mixed
- getType() : int
- Return the object type octet.
- getTypeName() : mixed
- Returns the name of the ASN.1 Type of this object.
- getVersion() : mixed
- key() : mixed
- next() : mixed
- offsetExists() : mixed
- offsetGet() : mixed
- offsetSet() : mixed
- offsetUnset() : mixed
- rewind() : mixed
- setSignature() : mixed
- valid() : mixed
- calculateContentLength() : int
- Must return the number of octets of the content part.
- createCSRSequence() : mixed
- getContentLength() : mixed
- getEncodedValue() : string
- Encode the object using DER encoding.
- getNumberOfLengthOctets() : mixed
- parseBinaryIdentifier() : mixed
- parseContentLength() : mixed
- parseIdentifier() : mixed
- setContentLength() : mixed
- createLengthPart() : mixed
Constants
CSR_VERSION_NR
public
mixed
CSR_VERSION_NR
= 0
Properties
$children
protected
array<string|int, ASNObject>
$children
$publicKey
protected
mixed
$publicKey
$signature
protected
mixed
$signature
$signatureAlgorithm
protected
mixed
$signatureAlgorithm
$startSequence
protected
mixed
$startSequence
$subject
protected
mixed
$subject
$contentLength
private
mixed
$contentLength
$iteratorPosition
private
mixed
$iteratorPosition
$nrOfLengthOctets
private
mixed
$nrOfLengthOctets
Methods
__construct()
public
__construct(string $commonName, string $email, string $organization, string $locality, string $state, string $country, string $organizationalUnit, string $publicKey[, string $signature = null ][, string $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE ]) : mixed
Parameters
- $commonName : string
- $email : string
- $organization : string
- $locality : string
- $state : string
- $country : string
- $organizationalUnit : string
- $publicKey : string
- $signature : string = null
- $signatureAlgorithm : string = OID::SHA1_WITH_RSA_SIGNATURE
Return values
mixed —__toString()
public
__toString() : mixed
Return values
mixed —addChild()
public
addChild(ASNObject $child) : mixed
Parameters
- $child : ASNObject
Return values
mixed —addChildren()
public
addChildren(array<string|int, mixed> $children) : mixed
Parameters
- $children : array<string|int, mixed>
Return values
mixed —count()
public
count([mixed $mode = COUNT_NORMAL ]) : mixed
Parameters
- $mode : mixed = COUNT_NORMAL
Return values
mixed —current()
public
current() : mixed
Return values
mixed —fromBinary()
Parse an instance of this class from its binary DER encoded representation.
public
static fromBinary(string &$binaryData[, int &$offsetIndex = 0 ]) : ASNObject
Parameters
- $binaryData : string
- $offsetIndex : int = 0
Tags
Return values
ASNObject —getBinary()
Encode this object using DER encoding.
public
getBinary() : string
Return values
string —the full binary representation of the complete object
getChildren()
public
getChildren() : array<string|int, ASNObject>
Return values
array<string|int, ASNObject> —getContent()
Return the content of this object in a non encoded form.
public
abstract getContent() : mixed
This can be used to print the value in human readable form.
Return values
mixed —getCountry()
public
getCountry() : mixed
Return values
mixed —getFirstChild()
public
getFirstChild() : ASNObject
Return values
ASNObject —getIdentifier()
Returns all identifier octets. If an inheriting class models a tag with the long form identifier format, it MUST reimplement this method to return all octets of the identifier.
public
getIdentifier() : string
Tags
Return values
string —Identifier as a set of octets
getIterator()
public
getIterator() : mixed
Return values
mixed —getLocalName()
public
getLocalName() : mixed
Return values
mixed —getNumberOfChildren()
public
getNumberOfChildren() : mixed
Return values
mixed —getObjectLength()
Returns the length of the whole object (including the identifier and length octets).
public
getObjectLength() : mixed
Return values
mixed —getOrganizationalUnit()
public
getOrganizationalUnit() : mixed
Return values
mixed —getOrganizationName()
public
getOrganizationName() : mixed
Return values
mixed —getPublicKey()
public
getPublicKey() : mixed
Return values
mixed —getSignature()
public
getSignature() : mixed
Return values
mixed —getSignatureAlgorithm()
public
getSignatureAlgorithm() : mixed
Return values
mixed —getSignatureSubject()
public
getSignatureSubject() : mixed
Return values
mixed —getState()
public
getState() : mixed
Return values
mixed —getType()
Return the object type octet.
public
abstract getType() : int
This should use the class constants of Identifier.
Tags
Return values
int —getTypeName()
Returns the name of the ASN.1 Type of this object.
public
getTypeName() : mixed
Tags
Return values
mixed —getVersion()
public
getVersion() : mixed
Return values
mixed —key()
public
key() : mixed
Return values
mixed —next()
public
next() : mixed
Return values
mixed —offsetExists()
public
offsetExists(mixed $offset) : mixed
Parameters
- $offset : mixed
Return values
mixed —offsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Return values
mixed —offsetSet()
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
Return values
mixed —offsetUnset()
public
offsetUnset(mixed $offset) : mixed
Parameters
- $offset : mixed
Return values
mixed —rewind()
public
rewind() : mixed
Return values
mixed —setSignature()
public
setSignature(mixed $signature[, mixed $signatureAlgorithm = OID::SHA1_WITH_RSA_SIGNATURE ]) : mixed
Parameters
- $signature : mixed
- $signatureAlgorithm : mixed = OID::SHA1_WITH_RSA_SIGNATURE
Return values
mixed —valid()
public
valid() : mixed
Return values
mixed —calculateContentLength()
Must return the number of octets of the content part.
protected
abstract calculateContentLength() : int
Return values
int —createCSRSequence()
protected
createCSRSequence() : mixed
Return values
mixed —getContentLength()
protected
getContentLength() : mixed
Return values
mixed —getEncodedValue()
Encode the object using DER encoding.
protected
abstract getEncodedValue() : string
Tags
Return values
string —the binary representation of an objects value
getNumberOfLengthOctets()
protected
getNumberOfLengthOctets([mixed $contentLength = null ]) : mixed
Parameters
- $contentLength : mixed = null
Return values
mixed —parseBinaryIdentifier()
protected
static parseBinaryIdentifier(mixed $binaryData, mixed &$offsetIndex) : mixed
Parameters
- $binaryData : mixed
- $offsetIndex : mixed
Return values
mixed —parseContentLength()
protected
static parseContentLength(mixed &$binaryData, mixed &$offsetIndex[, mixed $minimumLength = 0 ]) : mixed
Parameters
- $binaryData : mixed
- $offsetIndex : mixed
- $minimumLength : mixed = 0
Return values
mixed —parseIdentifier()
protected
static parseIdentifier(mixed $identifierOctet, mixed $expectedIdentifier, mixed $offsetForExceptionHandling) : mixed
Parameters
- $identifierOctet : mixed
- $expectedIdentifier : mixed
- $offsetForExceptionHandling : mixed
Return values
mixed —setContentLength()
protected
setContentLength(mixed $newContentLength) : mixed
Parameters
- $newContentLength : mixed
Return values
mixed —createLengthPart()
private
createLengthPart() : mixed