PKCS8

Extends\phpseclib3\Crypt\Common\Formats\Keys\PKCS8

PKCS#8 Formatted DSA Key Handler

author

Jim Wigginton terrafrost@php.net

package

Default

Methods

Returns the encryption parameters used by the key

extractEncryptionAlgorithm(string $key): array
static

Arguments

$key

string

Response

array

Returns a SymmetricKey object based on a PBES1 $algo

getPBES1EncryptionObject(string $algo): \phpseclib3\Crypt\Common\SymmetricKey
static

Arguments

$algo

string

Response

\phpseclib3\Crypt\Common\SymmetricKey

Returns a hash based on a PBES1 $algo

getPBES1Hash(string $algo): string
static

Arguments

$algo

string

Response

string

Returns a KDF baesd on a PBES1 $algo

getPBES1KDF(string $algo): string
static

Arguments

$algo

string

Response

string

Returns a SymmetricKey object baesd on a PBES2 $algo

getPBES2EncryptionObject(string $algo): \phpseclib3\Crypt\Common\Formats\Keys\SymmetricKey
static

Arguments

$algo

string

Response

\phpseclib3\Crypt\Common\Formats\Keys\SymmetricKey

Initialize static variables

initialize_static_variables()
static

Break a public or private key down into its constituent components

load(string $key,string $password = ''): array
static

Arguments

$key

string

$password

string

optional

Response

array

Perform some preliminary parsing of the key

preParse(string &$key): array
static

Arguments

$key

string

Response

array

Accept any format and auto detect the format

requireAny()
inheritedstatic

This is the default setting

Require raw DER's be supplied

requireDER()
inheritedstatic

Require base64-encoded PEM's be supplied

requirePEM()
inheritedstatic

Convert a private key to the appropriate format.

savePrivateKey(\phpseclib3\Math\BigInteger $p,\phpseclib3\Math\BigInteger $q,\phpseclib3\Math\BigInteger $g,\phpseclib3\Math\BigInteger $y,\phpseclib3\Math\BigInteger $x,string $password = '',array $options = array()): string
static

Arguments

$password

string

optional

$options

array

optional

Response

string

Convert a public key to the appropriate format

savePublicKey(\phpseclib3\Math\BigInteger $p,\phpseclib3\Math\BigInteger $q,\phpseclib3\Math\BigInteger $g,\phpseclib3\Math\BigInteger $y,array $options = array()): string
static

Sets the default encryption algorithm

setEncryptionAlgorithm(string $algo)
static

Arguments

$algo

string

Sets the default encryption algorithm for PBES2

setEncryptionScheme(string $algo)
static

Arguments

$algo

string

Sets the iteration count

setIterationCount(integer $count)
static

Arguments

$count

integer

Sets the PRF for PBES2

setPRF(string $algo)
static

Arguments

$algo

string

Wrap a private key appropriately

wrapPrivateKey(string $key,string $attr,mixed $params,string $password,string $oid = null,string $publicKey = '',array $options = array()): string
static

Arguments

$key

string

$attr

string

$params

mixed

$password

string

$oid

string

optional

$publicKey

string

optional

$options

array

optional

Response

string

Wrap a public key appropriately

wrapPublicKey(string $key,mixed $params,string $oid = null): string
static

Arguments

$key

string

$params

mixed

$oid

string

Response

string

Constants

OID Name

OID_NAME
var

OID Value

OID_VALUE
var

Auto-detect the format

MODE_ANY
inherited

Require base64-encoded PEM's be supplied

MODE_PEM
inherited

Require raw DER's be supplied

MODE_DER
inherited

Properties

Child OIDs loaded

childOIDsLoaded :boolean
static
var

Type(s)

boolean

Default encryption algorithm

defaultEncryptionAlgorithm :string
static
var

Type(s)

string

Default encryption scheme

defaultEncryptionScheme :string
static

Only used when defaultEncryptionAlgorithm is id-PBES2

var

Type(s)

string

Default PRF

defaultPRF :string
static

Only used when defaultEncryptionAlgorithm is id-PBES2

var

Type(s)

string

Default Iteration Count

defaultIterationCount :integer
static
var

Type(s)

integer

OIDs loaded

oidsLoaded :boolean
static
var

Type(s)

boolean

Is the key a base-64 encoded PEM, DER or should it be auto-detected?

format :integer
inheritedstatic
var

Type(s)

integer