Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe ASN1

Fonctions membres publiques statiques

static decodeBER ($encoded)
 
static asn1map ($decoded, $mapping, $special=[])
 
static decodeLength (&$string)
 
static encodeDER ($source, $mapping, $special=[])
 
static decodeOID ($content)
 
static encodeOID ($source)
 
static setTimeFormat ($format)
 
static loadOIDs ($oids)
 
static setFilters ($filters)
 
static convert ($in, $from=self::TYPE_UTF8_STRING, $to=self::TYPE_UTF8_STRING)
 
static extractBER ($str)
 
static encodeLength ($length)
 
static getOID ($name)
 

Champs de données

const CLASS_UNIVERSAL = 0
 
const CLASS_APPLICATION = 1
 
const CLASS_CONTEXT_SPECIFIC = 2
 
const CLASS_PRIVATE = 3
 
const TYPE_BOOLEAN = 1
 
const TYPE_INTEGER = 2
 
const TYPE_BIT_STRING = 3
 
const TYPE_OCTET_STRING = 4
 
const TYPE_NULL = 5
 
const TYPE_OBJECT_IDENTIFIER = 6
 
const TYPE_REAL = 9
 
const TYPE_ENUMERATED = 10
 
const TYPE_UTF8_STRING = 12
 
const TYPE_SEQUENCE = 16
 
const TYPE_SET = 17
 
const TYPE_NUMERIC_STRING = 18
 
const TYPE_PRINTABLE_STRING = 19
 
const TYPE_TELETEX_STRING = 20
 
const TYPE_VIDEOTEX_STRING = 21
 
const TYPE_IA5_STRING = 22
 
const TYPE_UTC_TIME = 23
 
const TYPE_GENERALIZED_TIME = 24
 
const TYPE_GRAPHIC_STRING = 25
 
const TYPE_VISIBLE_STRING = 26
 
const TYPE_GENERAL_STRING = 27
 
const TYPE_UNIVERSAL_STRING = 28
 
const TYPE_BMP_STRING = 30
 
const TYPE_CHOICE = -1
 
const TYPE_ANY = -2
 
const ANY_MAP
 
const STRING_TYPE_SIZE
 

Fonctions membres privées statiques

static encode_der ($source, $mapping, $idx=null, $special=[])
 
static decodeTime ($content, $tag)
 

Attributs privés statiques

static $oids = []
 
static $reverseOIDs = []
 
static $format = 'D, d M Y H:i:s O'
 
static $filters
 
static $location
 
static $encoded
 

Documentation des fonctions membres

◆ asn1map()

static asn1map (   $decoded,
  $mapping,
  $special = [] 
)
static

ASN.1 Map

Provides an ASN.1 semantic mapping ($mapping) from a parsed BER-encoding to a human readable format.

"Special" mappings may be applied on a per tag-name basis via $special.

Paramètres
array$decoded
array$mapping
array$special
Renvoie
array|bool|Element|string|null public

Références $content, $format, $i, $key, $n, Joomla\Database\Query\$offset, $option, $size, $temp, $value, elseif, et null.

Référencé par X509\computeKeyIdentifier(), PKCS8\extractEncryptionAlgorithm(), X509\formatSubjectPublicKey(), EC\getCurve(), X509\getDNProp(), PKCS1\load(), PSS\load(), PKCS8\load(), X509\loadCRL(), X509\loadCSR(), phpseclib3\Crypt\EC\Formats\Keys\loadCurveByParam(), X509\loadSPKAC(), X509\loadX509(), X509\mapInAttributes(), X509\mapInDNs(), X509\mapInExtensions(), X509\mapOutAttributes(), et PublicKey\rsassa_pkcs1_v1_5_relaxed_verify().

◆ convert()

static convert (   $in,
  $from = self::TYPE_UTF8_STRING,
  $to = self::TYPE_UTF8_STRING 
)
static

String type conversion

This is a lazy conversion, dealing only with character size. No real conversion table is used.

Paramètres
string$in
int$from
int$to
Renvoie
string public

Références $c, et $i.

Référencé par X509\getDN(), et X509\getDNProp().

◆ decodeBER()

◆ decodeLength()

static decodeLength ( $string)
static

DER-decode the length

DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See X.690 paragraph 8.1.3 for more information.

public

Paramètres
string$string
Renvoie
int

Références $temp, et Strings\shift().

◆ decodeOID()

static decodeOID (   $content)
static

BER-decode the OID

Called by _decode_ber()

public

Paramètres
string$content
Renvoie
string

Références $content, $n, $oid, et $temp.

◆ decodeTime()

static decodeTime (   $content,
  $tag 
)
staticprivate

BER-decode the time

Called by _decode_ber() and in the case of implicit tags asn1map().

private

Paramètres
string$content
int$tag
Renvoie
|false

Références $content, ASN1\$format, $prefix, et elseif.

◆ encode_der()

static encode_der (   $source,
  $mapping,
  $idx = null,
  $special = [] 
)
staticprivate

ASN.1 Encode (Helper function)

Paramètres
Element | string | array | null$source
array$mapping
int$idx
array$special
Renvoie
string private

Références $content, $date, $filters, ASN1\$filters, ASN1\$format, $i, $key, $location, Joomla\Database\Query\$offset, $size, $temp, $value, et null.

◆ encodeDER()

static encodeDER (   $source,
  $mapping,
  $special = [] 
)
static

ASN.1 Encode

DER-encodes an ASN.1 semantic mapping ($mapping). Some libraries would probably call this function an ASN.1 compiler.

"Special" mappings can be applied via $special.

Paramètres
Element | string | array$source
array$mapping
array$special
Renvoie
string public

Références $location, et null.

Référencé par phpseclib3\Crypt\EC\Formats\Keys\encodeParameters(), X509\getDN(), X509\loadCSR(), X509\loadSPKAC(), X509\loadX509(), X509\mapInAttributes(), X509\mapOutAttributes(), X509\mapOutDNs(), X509\mapOutExtensions(), X509\saveCRL(), X509\saveCSR(), PKCS1\saveParameters(), PKCS1\savePrivateKey(), PKCS8\savePrivateKey(), PSS\savePSSParams(), PKCS1\savePublicKey(), PKCS8\savePublicKey(), X509\saveSPKAC(), X509\saveX509(), PKCS8\wrapPrivateKey(), et PKCS8\wrapPublicKey().

◆ encodeLength()

static encodeLength (   $length)
static

DER-encode the length

DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See X.690 paragraph 8.1.3 for more information.

public

Paramètres
int$length
Renvoie
string

Références $temp.

Référencé par X509\setEndDate().

◆ encodeOID()

static encodeOID (   $source)
static

DER-encode the OID

Called by _encode_der()

public

Paramètres
string$source
Renvoie
string

Références $oid, $parts, $temp, et $value.

◆ extractBER()

static extractBER (   $str)
static

◆ getOID()

static getOID (   $name)
static

Returns the OID corresponding to a name

What's returned in the associative array returned by loadX509() (or load*()) is either a name or an OID if no OID to name mapping is available. The problem with this is that what may be an unmapped OID in one version of phpseclib may not be unmapped in the next version, so apps that are looking at this OID may not be able to work from version to version.

This method will return the OID if a name is passed to it and if no mapping is avialable it'll assume that what's being passed to it already is an OID and return that instead. A few examples.

getOID('2.16.840.1.101.3.4.2.1') == '2.16.840.1.101.3.4.2.1' getOID('id-sha256') == '2.16.840.1.101.3.4.2.1' getOID('zzz') == 'zzz'

public

Paramètres
string$name
Renvoie
string

Références $name.

◆ loadOIDs()

static loadOIDs (   $oids)
static

Load OIDs

Load the relevant OIDs for a particular ASN.1 semantic mapping. Previously loaded OIDs are retained.

public

Paramètres
array$oids

Références ASN1\$oids.

Référencé par X509\__construct(), phpseclib3\Crypt\EC\Formats\Keys\initialize_static_variables(), PSS\initialize_static_variables(), PKCS8\initialize_static_variables(), et PublicKey\rsassa_pkcs1_v1_5_relaxed_verify().

◆ setFilters()

static setFilters (   $filters)
static

Set filters

See , etc, for an example. Previously loaded filters are not retained.

public

Paramètres
array$filters

Références $filters, et ASN1\$filters.

Référencé par X509\getDN(), X509\getDNProp(), X509\saveCRL(), X509\saveCSR(), et X509\saveX509().

◆ setTimeFormat()

static setTimeFormat (   $format)
static

Set the time format

Sets the time / date format for asn1map().

public

Paramètres
string$format

Références $format, et ASN1\$format.

Documentation des champs

◆ $encoded

$encoded
staticprivate

Référencé par Element\__construct(), et ASN1\decodeBER().

◆ $filters

$filters
staticprivate

Référencé par ASN1\encode_der(), et ASN1\setFilters().

◆ $format

$format = 'D, d M Y H:i:s O'
staticprivate

◆ $location

$location
staticprivate

◆ $oids

$oids = []
staticprivate

Référencé par ASN1\loadOIDs().

◆ $reverseOIDs

$reverseOIDs = []
staticprivate

◆ ANY_MAP

const ANY_MAP
Valeur initiale :
= [
self::TYPE_BOOLEAN => true

Référencé par X509\getDN(), et X509\getDNProp().

◆ CLASS_APPLICATION

const CLASS_APPLICATION = 1

◆ CLASS_CONTEXT_SPECIFIC

const CLASS_CONTEXT_SPECIFIC = 2

Référencé par X509\mapOutExtensions().

◆ CLASS_PRIVATE

const CLASS_PRIVATE = 3

◆ CLASS_UNIVERSAL

const CLASS_UNIVERSAL = 0

◆ STRING_TYPE_SIZE

const STRING_TYPE_SIZE
Valeur initiale :
= [
self::TYPE_UTF8_STRING => 0

Référencé par X509\getDN(), et X509\getDNProp().

◆ TYPE_ANY

const TYPE_ANY = -2

◆ TYPE_BIT_STRING

const TYPE_BIT_STRING = 3

Référencé par X509\computeKeyIdentifier().

◆ TYPE_BMP_STRING

const TYPE_BMP_STRING = 30

◆ TYPE_BOOLEAN

const TYPE_BOOLEAN = 1

◆ TYPE_CHOICE

const TYPE_CHOICE = -1

◆ TYPE_ENUMERATED

const TYPE_ENUMERATED = 10

◆ TYPE_GENERAL_STRING

const TYPE_GENERAL_STRING = 27

◆ TYPE_GENERALIZED_TIME

const TYPE_GENERALIZED_TIME = 24

Référencé par X509\setEndDate().

◆ TYPE_GRAPHIC_STRING

const TYPE_GRAPHIC_STRING = 25

◆ TYPE_IA5_STRING

const TYPE_IA5_STRING = 22

Référencé par X509\saveX509().

◆ TYPE_INTEGER

const TYPE_INTEGER = 2

◆ TYPE_NULL

const TYPE_NULL = 5

Référencé par X509\saveCRL().

◆ TYPE_NUMERIC_STRING

const TYPE_NUMERIC_STRING = 18

◆ TYPE_OBJECT_IDENTIFIER

const TYPE_OBJECT_IDENTIFIER = 6

◆ TYPE_OCTET_STRING

const TYPE_OCTET_STRING = 4

◆ TYPE_PRINTABLE_STRING

const TYPE_PRINTABLE_STRING = 19

◆ TYPE_REAL

const TYPE_REAL = 9

◆ TYPE_SEQUENCE

const TYPE_SEQUENCE = 16

◆ TYPE_SET

const TYPE_SET = 17

◆ TYPE_TELETEX_STRING

const TYPE_TELETEX_STRING = 20

◆ TYPE_UNIVERSAL_STRING

const TYPE_UNIVERSAL_STRING = 28

◆ TYPE_UTC_TIME

const TYPE_UTC_TIME = 23

◆ TYPE_UTF8_STRING

const TYPE_UTF8_STRING = 12

◆ TYPE_VIDEOTEX_STRING

const TYPE_VIDEOTEX_STRING = 21

◆ TYPE_VISIBLE_STRING

const TYPE_VISIBLE_STRING = 26

La documentation de cette classe a été générée à partir du fichier suivant :