PKCS8
abstract class PKCS8 extends PKCS8 (View source)
PKCS#8 Formatted EC Key Handler
Traits
Constants
MODE_ANY |
Auto-detect the format |
MODE_PEM |
Require base64-encoded PEM's be supplied |
MODE_DER |
Require raw DER's be supplied |
OID_NAME |
OID Name |
OID_VALUE |
OID Value |
Properties
static protected int | $format | Is the key a base-64 encoded PEM, DER or should it be auto-detected? | from PKCS |
static protected bool | $childOIDsLoaded | Child OIDs loaded | from Common |
Methods
Break a public or private key down into its constituent components
Wrap a private key appropriately
Wrap a public key appropriately
Returns the encryption parameters used by the key
Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters
Convert an EC public key to the appropriate format
Convert a private key to the appropriate format.
Details
in
PKCS at line 54
static
requirePEM()
Require base64-encoded PEM's be supplied
in
PKCS at line 64
static
requireDER()
Require raw DER's be supplied
in
PKCS at line 76
static
requireAny()
Accept any format and auto detect the format
This is the default setting
in
PKCS8 at line 102
static
setEncryptionAlgorithm(string $algo)
Sets the default encryption algorithm
in
PKCS8 at line 113
static
setEncryptionScheme(string $algo)
Sets the default encryption algorithm for PBES2
in
PKCS8 at line 124
static
setIterationCount(int $count)
Sets the iteration count
in
PKCS8 at line 135
static
setPRF(string $algo)
Sets the PRF for PBES2
static array
load(string $key, string $password = '')
Break a public or private key down into its constituent components
in
PKCS8 at line 515
static protected string
wrapPrivateKey(string $key, string $attr, mixed $params, string $password, string $oid = null, string $publicKey = '', array $options = [])
Wrap a private key appropriately
in
PKCS8 at line 623
static protected string
wrapPublicKey(string $key, mixed $params, string $oid = null)
Wrap a public key appropriately
in
PKCS8 at line 679
static array
extractEncryptionAlgorithm(string $key)
Returns the encryption parameters used by the key
static
setImplicitCurve(Base $curve)
Explicitly set the curve
If the key contains an implicit curve phpseclib needs the curve to be explicitly provided
static protected Base|false
loadCurveByParam(array $params)
Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based on the curve parameters
static object[]
extractPoint(string $str, Base $curve)
Extract points from a string
Supports both compressed and uncompressed points
static
useSpecifiedCurve()
Use Specified Curve
A specified curve has all the coefficients, the base points, etc, explicitely included. A specified curve is a more verbose way of representing a curve
static
useNamedCurve()
Use Named Curve
A named curve does not include any parameters. It is up to the EC parameters to know what the coefficients, the base points, etc, are from the name of the curve. A named curve is a more concise way of representing a curve
static string
savePublicKey(Base $curve, array $publicKey, array $options = [])
Convert an EC public key to the appropriate format