mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 13:28:27 +00:00
Php 7.1
This commit is contained in:
parent
e210166f43
commit
7154fd98d2
@ -1712,11 +1712,6 @@
|
|||||||
<ImplicitToStringCast occurrences="1">
|
<ImplicitToStringCast occurrences="1">
|
||||||
<code>string</code>
|
<code>string</code>
|
||||||
</ImplicitToStringCast>
|
</ImplicitToStringCast>
|
||||||
<InvalidParamDefault occurrences="3">
|
|
||||||
<code>string</code>
|
|
||||||
<code>string</code>
|
|
||||||
<code>string</code>
|
|
||||||
</InvalidParamDefault>
|
|
||||||
<MissingReturnType occurrences="1">
|
<MissingReturnType occurrences="1">
|
||||||
<code>validatePlugin</code>
|
<code>validatePlugin</code>
|
||||||
</MissingReturnType>
|
</MissingReturnType>
|
||||||
@ -1934,11 +1929,9 @@
|
|||||||
<MixedAssignment occurrences="1">
|
<MixedAssignment occurrences="1">
|
||||||
<code>$encryptionAlgorithm</code>
|
<code>$encryptionAlgorithm</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
<PossiblyFalseArgument occurrences="1">
|
<PossiblyNullArgument occurrences="2">
|
||||||
<code>$password</code>
|
|
||||||
</PossiblyFalseArgument>
|
|
||||||
<PossiblyNullArgument occurrences="1">
|
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
|
<code>$password</code>
|
||||||
</PossiblyNullArgument>
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="6">
|
<PossiblyUndefinedIntArrayOffset occurrences="6">
|
||||||
<code>$matches[1]</code>
|
<code>$matches[1]</code>
|
||||||
@ -2411,10 +2404,9 @@
|
|||||||
<MissingParamType occurrences="1">
|
<MissingParamType occurrences="1">
|
||||||
<code>$message</code>
|
<code>$message</code>
|
||||||
</MissingParamType>
|
</MissingParamType>
|
||||||
<MissingReturnType occurrences="3">
|
<MissingReturnType occurrences="2">
|
||||||
<code>getPublicKey</code>
|
<code>getPublicKey</code>
|
||||||
<code>sign</code>
|
<code>sign</code>
|
||||||
<code>withPassword</code>
|
|
||||||
</MissingReturnType>
|
</MissingReturnType>
|
||||||
</file>
|
</file>
|
||||||
<file src="../phpseclib/Crypt/Common/PublicKey.php">
|
<file src="../phpseclib/Crypt/Common/PublicKey.php">
|
||||||
@ -2878,11 +2870,6 @@
|
|||||||
<code>$key === false</code>
|
<code>$key === false</code>
|
||||||
</TypeDoesNotContainType>
|
</TypeDoesNotContainType>
|
||||||
</file>
|
</file>
|
||||||
<file src="../phpseclib/Crypt/Common/Traits/PasswordProtected.php">
|
|
||||||
<MissingReturnType occurrences="1">
|
|
||||||
<code>withPassword</code>
|
|
||||||
</MissingReturnType>
|
|
||||||
</file>
|
|
||||||
<file src="../phpseclib/Crypt/DES.php">
|
<file src="../phpseclib/Crypt/DES.php">
|
||||||
<InvalidPropertyAssignmentValue occurrences="2">
|
<InvalidPropertyAssignmentValue occurrences="2">
|
||||||
<code>8</code>
|
<code>8</code>
|
||||||
@ -3196,9 +3183,6 @@
|
|||||||
<InvalidArgument occurrences="1">
|
<InvalidArgument occurrences="1">
|
||||||
<code>$args[0]</code>
|
<code>$args[0]</code>
|
||||||
</InvalidArgument>
|
</InvalidArgument>
|
||||||
<InvalidParamDefault occurrences="1">
|
|
||||||
<code>string</code>
|
|
||||||
</InvalidParamDefault>
|
|
||||||
<MissingParamType occurrences="1">
|
<MissingParamType occurrences="1">
|
||||||
<code>$args</code>
|
<code>$args</code>
|
||||||
</MissingParamType>
|
</MissingParamType>
|
||||||
@ -3277,6 +3261,9 @@
|
|||||||
<MixedPropertyFetch occurrences="1">
|
<MixedPropertyFetch occurrences="1">
|
||||||
<code>$key[$type . 'Algorithm']['parameters']->element</code>
|
<code>$key[$type . 'Algorithm']['parameters']->element</code>
|
||||||
</MixedPropertyFetch>
|
</MixedPropertyFetch>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyNullArrayAccess occurrences="2">
|
<PossiblyNullArrayAccess occurrences="2">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -3468,6 +3455,9 @@
|
|||||||
<MixedOperand occurrences="1">
|
<MixedOperand occurrences="1">
|
||||||
<code>$comment</code>
|
<code>$comment</code>
|
||||||
</MixedOperand>
|
</MixedOperand>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedStringArrayOffset occurrences="4">
|
<PossiblyUndefinedStringArrayOffset occurrences="4">
|
||||||
<code>$parsed['comment']</code>
|
<code>$parsed['comment']</code>
|
||||||
<code>$parsed['publicKey']</code>
|
<code>$parsed['publicKey']</code>
|
||||||
@ -3517,6 +3507,9 @@
|
|||||||
<MixedPropertyFetch occurrences="1">
|
<MixedPropertyFetch occurrences="1">
|
||||||
<code>$key[$type . 'Algorithm']['parameters']->element</code>
|
<code>$key[$type . 'Algorithm']['parameters']->element</code>
|
||||||
</MixedPropertyFetch>
|
</MixedPropertyFetch>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="2">
|
<PossiblyUndefinedIntArrayOffset occurrences="2">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -3544,9 +3537,6 @@
|
|||||||
<code>$y</code>
|
<code>$y</code>
|
||||||
<code>$y</code>
|
<code>$y</code>
|
||||||
</ImplicitToStringCast>
|
</ImplicitToStringCast>
|
||||||
<InvalidParamDefault occurrences="1">
|
|
||||||
<code>string</code>
|
|
||||||
</InvalidParamDefault>
|
|
||||||
<MixedArrayAccess occurrences="1">
|
<MixedArrayAccess occurrences="1">
|
||||||
<code>$components['public']</code>
|
<code>$components['public']</code>
|
||||||
</MixedArrayAccess>
|
</MixedArrayAccess>
|
||||||
@ -3554,6 +3544,9 @@
|
|||||||
<code>$private</code>
|
<code>$private</code>
|
||||||
<code>$public</code>
|
<code>$public</code>
|
||||||
</NullReference>
|
</NullReference>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<UnusedClass occurrences="1">
|
<UnusedClass occurrences="1">
|
||||||
<code>PuTTY</code>
|
<code>PuTTY</code>
|
||||||
</UnusedClass>
|
</UnusedClass>
|
||||||
@ -6074,10 +6067,10 @@
|
|||||||
<PossiblyUndefinedIntArrayOffset occurrences="1">
|
<PossiblyUndefinedIntArrayOffset occurrences="1">
|
||||||
<code>$publicKey[0]</code>
|
<code>$publicKey[0]</code>
|
||||||
</PossiblyUndefinedIntArrayOffset>
|
</PossiblyUndefinedIntArrayOffset>
|
||||||
<RedundantConditionGivenDocblockType occurrences="2">
|
<RedundantCondition occurrences="2">
|
||||||
<code>!empty($password) && is_string($password)</code>
|
<code>!empty($password) && is_string($password)</code>
|
||||||
<code>is_string($password)</code>
|
<code>is_string($password)</code>
|
||||||
</RedundantConditionGivenDocblockType>
|
</RedundantCondition>
|
||||||
<UndefinedMethod occurrences="1">
|
<UndefinedMethod occurrences="1">
|
||||||
<code>toBytes</code>
|
<code>toBytes</code>
|
||||||
</UndefinedMethod>
|
</UndefinedMethod>
|
||||||
@ -6199,6 +6192,9 @@
|
|||||||
<code>$decoded</code>
|
<code>$decoded</code>
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
</PossiblyInvalidArgument>
|
</PossiblyInvalidArgument>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="7">
|
<PossiblyUndefinedIntArrayOffset occurrences="7">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -6273,8 +6269,10 @@
|
|||||||
<PossiblyInvalidArrayOffset occurrences="1">
|
<PossiblyInvalidArrayOffset occurrences="1">
|
||||||
<code>$key['privateKey']</code>
|
<code>$key['privateKey']</code>
|
||||||
</PossiblyInvalidArrayOffset>
|
</PossiblyInvalidArrayOffset>
|
||||||
<PossiblyNullArgument occurrences="1">
|
<PossiblyNullArgument occurrences="3">
|
||||||
<code>$key['privateKey']</code>
|
<code>$key['privateKey']</code>
|
||||||
|
<code>$password</code>
|
||||||
|
<code>$password</code>
|
||||||
</PossiblyNullArgument>
|
</PossiblyNullArgument>
|
||||||
<PossiblyNullArrayAccess occurrences="1">
|
<PossiblyNullArrayAccess occurrences="1">
|
||||||
<code>$key['privateKey']</code>
|
<code>$key['privateKey']</code>
|
||||||
@ -6326,9 +6324,6 @@
|
|||||||
<InvalidArgument occurrences="1">
|
<InvalidArgument occurrences="1">
|
||||||
<code>$publicKey</code>
|
<code>$publicKey</code>
|
||||||
</InvalidArgument>
|
</InvalidArgument>
|
||||||
<InvalidParamDefault occurrences="1">
|
|
||||||
<code>string</code>
|
|
||||||
</InvalidParamDefault>
|
|
||||||
<MixedArgument occurrences="7">
|
<MixedArgument occurrences="7">
|
||||||
<code>$components['type']</code>
|
<code>$components['type']</code>
|
||||||
<code>$length</code>
|
<code>$length</code>
|
||||||
@ -6354,6 +6349,9 @@
|
|||||||
<code>$length</code>
|
<code>$length</code>
|
||||||
<code>$length</code>
|
<code>$length</code>
|
||||||
</PossiblyInvalidArrayAccess>
|
</PossiblyInvalidArrayAccess>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="2">
|
<PossiblyUndefinedIntArrayOffset occurrences="2">
|
||||||
<code>$public[1]</code>
|
<code>$public[1]</code>
|
||||||
<code>$public[1]</code>
|
<code>$public[1]</code>
|
||||||
@ -6591,9 +6589,11 @@
|
|||||||
<PossiblyUnusedParam occurrences="1">
|
<PossiblyUnusedParam occurrences="1">
|
||||||
<code>$password</code>
|
<code>$password</code>
|
||||||
</PossiblyUnusedParam>
|
</PossiblyUnusedParam>
|
||||||
<RedundantConditionGivenDocblockType occurrences="3">
|
<RedundantCondition occurrences="2">
|
||||||
<code>!empty($password) && is_string($password)</code>
|
<code>!empty($password) && is_string($password)</code>
|
||||||
<code>is_string($password)</code>
|
<code>is_string($password)</code>
|
||||||
|
</RedundantCondition>
|
||||||
|
<RedundantConditionGivenDocblockType occurrences="1">
|
||||||
<code>isset($public)</code>
|
<code>isset($public)</code>
|
||||||
</RedundantConditionGivenDocblockType>
|
</RedundantConditionGivenDocblockType>
|
||||||
</file>
|
</file>
|
||||||
@ -6688,7 +6688,7 @@
|
|||||||
<code>getPublicKey</code>
|
<code>getPublicKey</code>
|
||||||
<code>sign</code>
|
<code>sign</code>
|
||||||
</MissingReturnType>
|
</MissingReturnType>
|
||||||
<MixedArgument occurrences="10">
|
<MixedArgument occurrences="9">
|
||||||
<code>$curve::HASH</code>
|
<code>$curve::HASH</code>
|
||||||
<code>$curve::SIZE</code>
|
<code>$curve::SIZE</code>
|
||||||
<code>$curve::SIZE</code>
|
<code>$curve::SIZE</code>
|
||||||
@ -6698,7 +6698,6 @@
|
|||||||
<code>$this->curve->getBasePoint()</code>
|
<code>$this->curve->getBasePoint()</code>
|
||||||
<code>$this->dA->secret</code>
|
<code>$this->dA->secret</code>
|
||||||
<code>$this->dA->toBytes()</code>
|
<code>$this->dA->toBytes()</code>
|
||||||
<code>$this->withPassword()->toString('libsodium')</code>
|
|
||||||
</MixedArgument>
|
</MixedArgument>
|
||||||
<MixedArrayAccess occurrences="1">
|
<MixedArrayAccess occurrences="1">
|
||||||
<code>$r</code>
|
<code>$r</code>
|
||||||
@ -6719,7 +6718,7 @@
|
|||||||
<code>string</code>
|
<code>string</code>
|
||||||
<code>string</code>
|
<code>string</code>
|
||||||
</MixedInferredReturnType>
|
</MixedInferredReturnType>
|
||||||
<MixedMethodCall occurrences="16">
|
<MixedMethodCall occurrences="15">
|
||||||
<code>$format::save($r, $s)</code>
|
<code>$format::save($r, $s)</code>
|
||||||
<code>$format::save($r, $s)</code>
|
<code>$format::save($r, $s)</code>
|
||||||
<code>$format::save($r, $s, $this->getCurve())</code>
|
<code>$format::save($r, $s, $this->getCurve())</code>
|
||||||
@ -6734,7 +6733,6 @@
|
|||||||
<code>toBytes</code>
|
<code>toBytes</code>
|
||||||
<code>toBytes</code>
|
<code>toBytes</code>
|
||||||
<code>toBytes</code>
|
<code>toBytes</code>
|
||||||
<code>toString</code>
|
|
||||||
<code>withContext</code>
|
<code>withContext</code>
|
||||||
</MixedMethodCall>
|
</MixedMethodCall>
|
||||||
<MixedOperand occurrences="6">
|
<MixedOperand occurrences="6">
|
||||||
@ -7452,10 +7450,6 @@
|
|||||||
</UnusedVariable>
|
</UnusedVariable>
|
||||||
</file>
|
</file>
|
||||||
<file src="../phpseclib/Crypt/PublicKeyLoader.php">
|
<file src="../phpseclib/Crypt/PublicKeyLoader.php">
|
||||||
<InvalidParamDefault occurrences="2">
|
|
||||||
<code>string</code>
|
|
||||||
<code>string</code>
|
|
||||||
</InvalidParamDefault>
|
|
||||||
<MixedAssignment occurrences="1">
|
<MixedAssignment occurrences="1">
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
@ -7949,10 +7943,10 @@
|
|||||||
<code>$primes[1]</code>
|
<code>$primes[1]</code>
|
||||||
<code>$primes[2]</code>
|
<code>$primes[2]</code>
|
||||||
</PossiblyUndefinedIntArrayOffset>
|
</PossiblyUndefinedIntArrayOffset>
|
||||||
<RedundantConditionGivenDocblockType occurrences="2">
|
<RedundantCondition occurrences="2">
|
||||||
<code>!empty($password) && is_string($password)</code>
|
<code>!empty($password) && is_string($password)</code>
|
||||||
<code>is_string($password)</code>
|
<code>is_string($password)</code>
|
||||||
</RedundantConditionGivenDocblockType>
|
</RedundantCondition>
|
||||||
<TypeDoesNotContainType occurrences="1">
|
<TypeDoesNotContainType occurrences="1">
|
||||||
<code>is_string($key)</code>
|
<code>is_string($key)</code>
|
||||||
</TypeDoesNotContainType>
|
</TypeDoesNotContainType>
|
||||||
@ -7991,6 +7985,9 @@
|
|||||||
<MixedOperand occurrences="1">
|
<MixedOperand occurrences="1">
|
||||||
<code>$comment</code>
|
<code>$comment</code>
|
||||||
</MixedOperand>
|
</MixedOperand>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="3">
|
<PossiblyUndefinedIntArrayOffset occurrences="3">
|
||||||
<code>$coefficients[2]</code>
|
<code>$coefficients[2]</code>
|
||||||
<code>$primes[1]</code>
|
<code>$primes[1]</code>
|
||||||
@ -8010,6 +8007,10 @@
|
|||||||
</PossiblyUnusedProperty>
|
</PossiblyUnusedProperty>
|
||||||
</file>
|
</file>
|
||||||
<file src="../phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php">
|
<file src="../phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php">
|
||||||
|
<MismatchingDocblockParamType occurrences="2">
|
||||||
|
<code>string|false</code>
|
||||||
|
<code>string|false</code>
|
||||||
|
</MismatchingDocblockParamType>
|
||||||
<MixedArgument occurrences="2">
|
<MixedArgument occurrences="2">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -8030,9 +8031,15 @@
|
|||||||
<code>$components['primes'][]</code>
|
<code>$components['primes'][]</code>
|
||||||
<code>$primeInfo</code>
|
<code>$primeInfo</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
|
<PossiblyFalseArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyFalseArgument>
|
||||||
<PossiblyInvalidArgument occurrences="1">
|
<PossiblyInvalidArgument occurrences="1">
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
</PossiblyInvalidArgument>
|
</PossiblyInvalidArgument>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="6">
|
<PossiblyUndefinedIntArrayOffset occurrences="6">
|
||||||
<code>$coefficients[2]</code>
|
<code>$coefficients[2]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -8061,6 +8068,9 @@
|
|||||||
<MixedAssignment occurrences="1">
|
<MixedAssignment occurrences="1">
|
||||||
<code>$result['meta']</code>
|
<code>$result['meta']</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUnusedMethod occurrences="1">
|
<PossiblyUnusedMethod occurrences="1">
|
||||||
<code>savePrivateKey</code>
|
<code>savePrivateKey</code>
|
||||||
</PossiblyUnusedMethod>
|
</PossiblyUnusedMethod>
|
||||||
@ -8125,11 +8135,12 @@
|
|||||||
<PossiblyInvalidMethodCall occurrences="1">
|
<PossiblyInvalidMethodCall occurrences="1">
|
||||||
<code>toString</code>
|
<code>toString</code>
|
||||||
</PossiblyInvalidMethodCall>
|
</PossiblyInvalidMethodCall>
|
||||||
<PossiblyNullArgument occurrences="4">
|
<PossiblyNullArgument occurrences="5">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
<code>$params['hashAlgorithm']['algorithm']</code>
|
<code>$params['hashAlgorithm']['algorithm']</code>
|
||||||
<code>$params['maskGenAlgorithm']['parameters']['algorithm']</code>
|
<code>$params['maskGenAlgorithm']['parameters']['algorithm']</code>
|
||||||
|
<code>$password</code>
|
||||||
</PossiblyNullArgument>
|
</PossiblyNullArgument>
|
||||||
<PossiblyNullArrayAccess occurrences="4">
|
<PossiblyNullArrayAccess occurrences="4">
|
||||||
<code>$decoded[0]</code>
|
<code>$decoded[0]</code>
|
||||||
@ -8211,6 +8222,9 @@
|
|||||||
<code>$private</code>
|
<code>$private</code>
|
||||||
<code>$public</code>
|
<code>$public</code>
|
||||||
</NullReference>
|
</NullReference>
|
||||||
|
<PossiblyNullArgument occurrences="1">
|
||||||
|
<code>$password</code>
|
||||||
|
</PossiblyNullArgument>
|
||||||
<PossiblyUndefinedIntArrayOffset occurrences="3">
|
<PossiblyUndefinedIntArrayOffset occurrences="3">
|
||||||
<code>$coefficients[2]</code>
|
<code>$coefficients[2]</code>
|
||||||
<code>$primes[1]</code>
|
<code>$primes[1]</code>
|
||||||
@ -8263,10 +8277,10 @@
|
|||||||
<code>subtract</code>
|
<code>subtract</code>
|
||||||
<code>subtract</code>
|
<code>subtract</code>
|
||||||
</MixedMethodCall>
|
</MixedMethodCall>
|
||||||
<RedundantConditionGivenDocblockType occurrences="2">
|
<RedundantCondition occurrences="2">
|
||||||
<code>!empty($password) && is_string($password)</code>
|
<code>!empty($password) && is_string($password)</code>
|
||||||
<code>is_string($password)</code>
|
<code>is_string($password)</code>
|
||||||
</RedundantConditionGivenDocblockType>
|
</RedundantCondition>
|
||||||
<UnusedClass occurrences="1">
|
<UnusedClass occurrences="1">
|
||||||
<code>Raw</code>
|
<code>Raw</code>
|
||||||
</UnusedClass>
|
</UnusedClass>
|
||||||
@ -10616,7 +10630,7 @@
|
|||||||
<code>signSPKAC</code>
|
<code>signSPKAC</code>
|
||||||
<code>translateDNProp</code>
|
<code>translateDNProp</code>
|
||||||
</MissingReturnType>
|
</MissingReturnType>
|
||||||
<MixedArgument occurrences="131">
|
<MixedArgument occurrences="130">
|
||||||
<code>$attribute['value']</code>
|
<code>$attribute['value']</code>
|
||||||
<code>$attribute['value']</code>
|
<code>$attribute['value']</code>
|
||||||
<code>$attribute['value']</code>
|
<code>$attribute['value']</code>
|
||||||
@ -10667,7 +10681,6 @@
|
|||||||
<code>$ipAddress</code>
|
<code>$ipAddress</code>
|
||||||
<code>$ip[0]</code>
|
<code>$ip[0]</code>
|
||||||
<code>$ip[1]</code>
|
<code>$ip[1]</code>
|
||||||
<code>$issuer->privateKey->withPassword()->toString('PSS')</code>
|
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
@ -11072,7 +11085,7 @@
|
|||||||
<code>array|false</code>
|
<code>array|false</code>
|
||||||
<code>bool</code>
|
<code>bool</code>
|
||||||
</MixedInferredReturnType>
|
</MixedInferredReturnType>
|
||||||
<MixedMethodCall occurrences="8">
|
<MixedMethodCall occurrences="7">
|
||||||
<code>__toString</code>
|
<code>__toString</code>
|
||||||
<code>add</code>
|
<code>add</code>
|
||||||
<code>equals</code>
|
<code>equals</code>
|
||||||
@ -11080,7 +11093,6 @@
|
|||||||
<code>getPublicKey</code>
|
<code>getPublicKey</code>
|
||||||
<code>toBytes</code>
|
<code>toBytes</code>
|
||||||
<code>toString</code>
|
<code>toString</code>
|
||||||
<code>toString</code>
|
|
||||||
</MixedMethodCall>
|
</MixedMethodCall>
|
||||||
<MixedOperand occurrences="5">
|
<MixedOperand occurrences="5">
|
||||||
<code>$issuer->privateKey->sign($this->signatureSubject)</code>
|
<code>$issuer->privateKey->sign($this->signatureSubject)</code>
|
||||||
@ -16577,8 +16589,7 @@
|
|||||||
</UnusedClass>
|
</UnusedClass>
|
||||||
</file>
|
</file>
|
||||||
<file src="../tests/Unit/Crypt/DSA/LoadDSAKeyTest.php">
|
<file src="../tests/Unit/Crypt/DSA/LoadDSAKeyTest.php">
|
||||||
<MixedAssignment occurrences="2">
|
<MixedAssignment occurrences="1">
|
||||||
<code>$dsa</code>
|
|
||||||
<code>$sig</code>
|
<code>$sig</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
<MixedMethodCall occurrences="3">
|
<MixedMethodCall occurrences="3">
|
||||||
@ -16691,13 +16702,12 @@
|
|||||||
<code>$sig = $privateKey->sign('')</code>
|
<code>$sig = $privateKey->sign('')</code>
|
||||||
<code>$sig = $privateKey->sign('')</code>
|
<code>$sig = $privateKey->sign('')</code>
|
||||||
</MixedArgument>
|
</MixedArgument>
|
||||||
<MixedAssignment occurrences="35">
|
<MixedAssignment occurrences="34">
|
||||||
<code>$QA</code>
|
<code>$QA</code>
|
||||||
<code>$curve</code>
|
<code>$curve</code>
|
||||||
<code>$dA</code>
|
<code>$dA</code>
|
||||||
<code>$oid</code>
|
<code>$oid</code>
|
||||||
<code>$privateKey</code>
|
<code>$privateKey</code>
|
||||||
<code>$privatekey</code>
|
|
||||||
<code>$public</code>
|
<code>$public</code>
|
||||||
<code>$publicKey</code>
|
<code>$publicKey</code>
|
||||||
<code>$publickey</code>
|
<code>$publickey</code>
|
||||||
@ -16728,14 +16738,12 @@
|
|||||||
<code>$signature2</code>
|
<code>$signature2</code>
|
||||||
<code>$signature2</code>
|
<code>$signature2</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
<MixedMethodCall occurrences="18">
|
<MixedMethodCall occurrences="16">
|
||||||
<code>createRandomMultiplier</code>
|
<code>createRandomMultiplier</code>
|
||||||
<code>getBasePoint</code>
|
<code>getBasePoint</code>
|
||||||
<code>getBasePoint</code>
|
<code>getBasePoint</code>
|
||||||
<code>getPublicKey</code>
|
|
||||||
<code>multiplyPoint</code>
|
<code>multiplyPoint</code>
|
||||||
<code>sign</code>
|
<code>sign</code>
|
||||||
<code>sign</code>
|
|
||||||
<code>verify</code>
|
<code>verify</code>
|
||||||
<code>verify</code>
|
<code>verify</code>
|
||||||
<code>verify</code>
|
<code>verify</code>
|
||||||
@ -16850,18 +16858,16 @@
|
|||||||
<InvalidArgument occurrences="1">
|
<InvalidArgument occurrences="1">
|
||||||
<code>$components['dA']</code>
|
<code>$components['dA']</code>
|
||||||
</InvalidArgument>
|
</InvalidArgument>
|
||||||
<MissingParamType occurrences="2">
|
<MissingParamType occurrences="1">
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$password</code>
|
|
||||||
</MissingParamType>
|
</MissingParamType>
|
||||||
<PossiblyUnusedMethod occurrences="1">
|
<PossiblyUnusedMethod occurrences="1">
|
||||||
<code>load</code>
|
<code>load</code>
|
||||||
</PossiblyUnusedMethod>
|
</PossiblyUnusedMethod>
|
||||||
</file>
|
</file>
|
||||||
<file src="../tests/Unit/Crypt/EC/Ed448PublicKey.php">
|
<file src="../tests/Unit/Crypt/EC/Ed448PublicKey.php">
|
||||||
<MissingParamType occurrences="2">
|
<MissingParamType occurrences="1">
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$password</code>
|
|
||||||
</MissingParamType>
|
</MissingParamType>
|
||||||
<PossiblyUnusedMethod occurrences="1">
|
<PossiblyUnusedMethod occurrences="1">
|
||||||
<code>load</code>
|
<code>load</code>
|
||||||
@ -17159,9 +17165,6 @@
|
|||||||
</UnusedVariable>
|
</UnusedVariable>
|
||||||
</file>
|
</file>
|
||||||
<file src="../tests/Unit/Crypt/RSA/LoadKeyTest.php">
|
<file src="../tests/Unit/Crypt/RSA/LoadKeyTest.php">
|
||||||
<InvalidArgument occurrences="1">
|
|
||||||
<code>false</code>
|
|
||||||
</InvalidArgument>
|
|
||||||
<InvalidCast occurrences="1">
|
<InvalidCast occurrences="1">
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
</InvalidCast>
|
</InvalidCast>
|
||||||
@ -17169,14 +17172,10 @@
|
|||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$pass</code>
|
<code>$pass</code>
|
||||||
</MissingParamType>
|
</MissingParamType>
|
||||||
<MixedArgument occurrences="11">
|
<MixedArgument occurrences="7">
|
||||||
<code>$encryptedKey</code>
|
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$pass</code>
|
<code>$pass</code>
|
||||||
<code>$pass</code>
|
|
||||||
<code>$pass</code>
|
|
||||||
<code>$pass</code>
|
|
||||||
<code>$r['meta']['algorithm']</code>
|
<code>$r['meta']['algorithm']</code>
|
||||||
<code>$r['meta']['cipher']</code>
|
<code>$r['meta']['cipher']</code>
|
||||||
<code>$r['meta']['prf']</code>
|
<code>$r['meta']['prf']</code>
|
||||||
@ -17196,20 +17195,16 @@
|
|||||||
<code>$r['meta']['cipher']</code>
|
<code>$r['meta']['cipher']</code>
|
||||||
<code>$r['meta']['prf']</code>
|
<code>$r['meta']['prf']</code>
|
||||||
</MixedArrayAccess>
|
</MixedArrayAccess>
|
||||||
<MixedAssignment occurrences="7">
|
<MixedAssignment occurrences="5">
|
||||||
<code>$encryptedKey</code>
|
|
||||||
<code>$key</code>
|
<code>$key</code>
|
||||||
<code>$key2</code>
|
|
||||||
<code>$rsa</code>
|
<code>$rsa</code>
|
||||||
<code>$rsa</code>
|
<code>$rsa</code>
|
||||||
<code>$rsa2</code>
|
<code>$rsa2</code>
|
||||||
<code>$sig</code>
|
<code>$sig</code>
|
||||||
</MixedAssignment>
|
</MixedAssignment>
|
||||||
<MixedMethodCall occurrences="5">
|
<MixedMethodCall occurrences="3">
|
||||||
<code>sign</code>
|
<code>sign</code>
|
||||||
<code>toString</code>
|
<code>toString</code>
|
||||||
<code>toString</code>
|
|
||||||
<code>toString</code>
|
|
||||||
<code>withPadding</code>
|
<code>withPadding</code>
|
||||||
</MixedMethodCall>
|
</MixedMethodCall>
|
||||||
<PossiblyFalseArgument occurrences="3">
|
<PossiblyFalseArgument occurrences="3">
|
||||||
@ -17249,9 +17244,6 @@
|
|||||||
<code>LoadKeyTest</code>
|
<code>LoadKeyTest</code>
|
||||||
<code>LoadKeyTest</code>
|
<code>LoadKeyTest</code>
|
||||||
</PropertyNotSetInConstructor>
|
</PropertyNotSetInConstructor>
|
||||||
<TooManyArguments occurrences="1">
|
|
||||||
<code>RSA::load($key, false, 'PKCS8')</code>
|
|
||||||
</TooManyArguments>
|
|
||||||
<UndefinedMethod occurrences="7">
|
<UndefinedMethod occurrences="7">
|
||||||
<code>asPrivateKey</code>
|
<code>asPrivateKey</code>
|
||||||
<code>sign</code>
|
<code>sign</code>
|
||||||
|
@ -127,9 +127,8 @@ abstract class AsymmetricKey
|
|||||||
* Load the key
|
* Load the key
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = false): AsymmetricKey
|
public static function load($key, ?string $password = null): AsymmetricKey
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
@ -208,10 +207,9 @@ abstract class AsymmetricKey
|
|||||||
/**
|
/**
|
||||||
* Load the key, assuming a specific format
|
* Load the key, assuming a specific format
|
||||||
*
|
*
|
||||||
* @param string $password optional
|
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
public static function loadFormat(string $type, string $key, $password = false): AsymmetricKey
|
public static function loadFormat(string $type, string $key, ?string $password = null): AsymmetricKey
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
@ -237,10 +235,8 @@ abstract class AsymmetricKey
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a private key
|
* Loads a private key
|
||||||
*
|
|
||||||
* @param string $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function loadPrivateKeyFormat(string $type, string $key, $password = false): PrivateKey
|
public static function loadPrivateKeyFormat(string $type, string $key, ?string $password = null): PrivateKey
|
||||||
{
|
{
|
||||||
$key = self::loadFormat($type, $key, $password);
|
$key = self::loadFormat($type, $key, $password);
|
||||||
if (!$key instanceof PrivateKey) {
|
if (!$key instanceof PrivateKey) {
|
||||||
|
@ -57,9 +57,8 @@ abstract class OpenSSH
|
|||||||
* $type can be either ssh-dss or ssh-rsa
|
* $type can be either ssh-dss or ssh-rsa
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
|
@ -106,10 +106,9 @@ abstract class PKCS1 extends PKCS
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
* @return array|string
|
* @return array|string
|
||||||
*/
|
*/
|
||||||
protected static function load($key, $password = '')
|
protected static function load($key, ?string $password = null)
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
|
@ -295,16 +295,15 @@ abstract class PKCS8 extends PKCS
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
protected static function load($key, $password = ''): array
|
protected static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
$decoded = self::preParse($key);
|
$decoded = self::preParse($key);
|
||||||
|
|
||||||
$meta = [];
|
$meta = [];
|
||||||
|
|
||||||
$decrypted = ASN1::asn1map($decoded[0], Maps\EncryptedPrivateKeyInfo::MAP);
|
$decrypted = ASN1::asn1map($decoded[0], Maps\EncryptedPrivateKeyInfo::MAP);
|
||||||
if ($password !== false && strlen($password) && is_array($decrypted)) {
|
if ($password !== null && strlen($password) && is_array($decrypted)) {
|
||||||
$algorithm = $decrypted['encryptionAlgorithm']['algorithm'];
|
$algorithm = $decrypted['encryptionAlgorithm']['algorithm'];
|
||||||
switch ($algorithm) {
|
switch ($algorithm) {
|
||||||
// PBES1
|
// PBES1
|
||||||
|
@ -26,7 +26,7 @@ interface PrivateKey
|
|||||||
public function toString(string $type, array $options = []): string;
|
public function toString(string $type, array $options = []): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|false $password
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withPassword($password = false);
|
public function withPassword(?string $password = null): PrivateKey;
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,9 @@ namespace phpseclib3\Crypt\Common\Traits;
|
|||||||
trait PasswordProtected
|
trait PasswordProtected
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Password
|
* @var string|null
|
||||||
*
|
|
||||||
* @var string|bool
|
|
||||||
*/
|
*/
|
||||||
private $password = false;
|
private $password = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the password
|
* Sets the password
|
||||||
@ -37,9 +35,10 @@ trait PasswordProtected
|
|||||||
*
|
*
|
||||||
* @see self::createKey()
|
* @see self::createKey()
|
||||||
* @see self::load()
|
* @see self::load()
|
||||||
* @param string|bool $password
|
*
|
||||||
|
* @return static
|
||||||
*/
|
*/
|
||||||
public function withPassword($password = false)
|
public function withPassword(?string $password = null): self
|
||||||
{
|
{
|
||||||
$new = clone $this;
|
$new = clone $this;
|
||||||
$new->password = $password;
|
$new->password = $password;
|
||||||
|
@ -307,9 +307,8 @@ abstract class DH extends AsymmetricKey
|
|||||||
* Load the key
|
* Load the key
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = false): AsymmetricKey
|
public static function load($key, ?string $password = null): AsymmetricKey
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return EC::load($key, $password);
|
return EC::load($key, $password);
|
||||||
|
@ -39,9 +39,8 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
$key = parent::load($key, $password);
|
$key = parent::load($key, $password);
|
||||||
|
|
||||||
|
@ -59,9 +59,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
@ -103,11 +102,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $prime, BigInteger $base, BigInteger $privateKey, BigInteger $publicKey, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $prime, BigInteger $base, BigInteger $privateKey, BigInteger $publicKey, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'prime' => $prime,
|
'prime' => $prime,
|
||||||
|
@ -39,9 +39,8 @@ abstract class OpenSSH extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
$parsed = parent::load($key, $password);
|
$parsed = parent::load($key, $password);
|
||||||
|
|
||||||
@ -94,11 +93,8 @@ abstract class OpenSSH extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$publicKey = self::savePublicKey($p, $q, $g, $y, ['binary' => true]);
|
$publicKey = self::savePublicKey($p, $q, $g, $y, ['binary' => true]);
|
||||||
$privateKey = Strings::packSSH2('si5', 'ssh-dss', $p, $q, $g, $y, $x);
|
$privateKey = Strings::packSSH2('si5', 'ssh-dss', $p, $q, $g, $y, $x);
|
||||||
|
@ -46,9 +46,8 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
$key = parent::load($key, $password);
|
$key = parent::load($key, $password);
|
||||||
|
|
||||||
|
@ -63,9 +63,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
@ -113,11 +112,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'p' => $p,
|
'p' => $p,
|
||||||
|
@ -69,11 +69,8 @@ abstract class PuTTY extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, $password = false, array $options = []): string
|
public static function savePrivateKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y, BigInteger $x, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
if ($q->getLength() != 160) {
|
if ($q->getLength() != 160) {
|
||||||
throw new \InvalidArgumentException('SSH only supports keys with an N (length of Group Order q) of 160');
|
throw new \InvalidArgumentException('SSH only supports keys with an N (length of Group Order q) of 160');
|
||||||
|
@ -30,9 +30,8 @@ abstract class Raw
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!is_array($key)) {
|
if (!is_array($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a array - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a array - not a ' . gettype($key));
|
||||||
|
@ -35,10 +35,8 @@ abstract class XML
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load(string $key, $password = ''): array
|
public static function load(string $key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
|
@ -43,10 +43,8 @@ abstract class MontgomeryPrivate
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load(string $key, $password = ''): array
|
public static function load(string $key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
switch (strlen($key)) {
|
switch (strlen($key)) {
|
||||||
case 32:
|
case 32:
|
||||||
@ -82,9 +80,8 @@ abstract class MontgomeryPrivate
|
|||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
*
|
||||||
* @param Integer[] $publicKey
|
* @param Integer[] $publicKey
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $privateKey, MontgomeryCurve $curve, array $publicKey, $password = ''): string
|
public static function savePrivateKey(BigInteger $privateKey, MontgomeryCurve $curve, array $publicKey, ?string $password = null): string
|
||||||
{
|
{
|
||||||
if (!empty($password) && is_string($password)) {
|
if (!empty($password) && is_string($password)) {
|
||||||
throw new UnsupportedFormatException('MontgomeryPrivate private keys do not support encryption');
|
throw new UnsupportedFormatException('MontgomeryPrivate private keys do not support encryption');
|
||||||
|
@ -34,10 +34,8 @@ abstract class MontgomeryPublic
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load(string $key, $password = ''): array
|
public static function load(string $key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
switch (strlen($key)) {
|
switch (strlen($key)) {
|
||||||
case 32:
|
case 32:
|
||||||
|
@ -49,9 +49,8 @@ abstract class OpenSSH extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
$parsed = parent::load($key, $password);
|
$parsed = parent::load($key, $password);
|
||||||
|
|
||||||
|
@ -52,9 +52,8 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
@ -164,10 +163,8 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
*
|
||||||
* @param Integer[] $publicKey
|
* @param Integer[] $publicKey
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
|
@ -65,9 +65,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
// initialize_static_variables() is defined in both the trait and the parent class
|
// initialize_static_variables() is defined in both the trait and the parent class
|
||||||
// when it's defined in two places it's the traits one that's called
|
// when it's defined in two places it's the traits one that's called
|
||||||
@ -201,10 +200,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
*
|
||||||
* @param Integer[] $publicKey
|
* @param Integer[] $publicKey
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
|
@ -86,10 +86,8 @@ abstract class PuTTY extends Progenitor
|
|||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
*
|
||||||
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
||||||
* @param string $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, $password = false, array $options = []): string
|
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
|
@ -57,9 +57,8 @@ abstract class XML
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
|
@ -39,10 +39,8 @@ abstract class libsodium
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
|
||||||
* @param string|false $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function load(string $key, $password = ''): array
|
public static function load(string $key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
switch (strlen($key)) {
|
switch (strlen($key)) {
|
||||||
case 32:
|
case 32:
|
||||||
@ -89,9 +87,8 @@ abstract class libsodium
|
|||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
*
|
||||||
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, $password = ''): string
|
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, ?string $password = null): string
|
||||||
{
|
{
|
||||||
if (!isset($privateKey->secret)) {
|
if (!isset($privateKey->secret)) {
|
||||||
throw new \RuntimeException('Private Key does not have a secret set');
|
throw new \RuntimeException('Private Key does not have a secret set');
|
||||||
|
@ -32,9 +32,8 @@ abstract class PublicKeyLoader
|
|||||||
* Loads a public or private key
|
* Loads a public or private key
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = false): AsymmetricKey
|
public static function load($key, ?string $password = null): AsymmetricKey
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return EC::load($key, $password);
|
return EC::load($key, $password);
|
||||||
@ -68,9 +67,8 @@ abstract class PublicKeyLoader
|
|||||||
* Loads a private key
|
* Loads a private key
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string $password optional
|
|
||||||
*/
|
*/
|
||||||
public static function loadPrivateKey($key, $password = false): PrivateKey
|
public static function loadPrivateKey($key, ?string $password = null): PrivateKey
|
||||||
{
|
{
|
||||||
$key = self::load($key, $password);
|
$key = self::load($key, $password);
|
||||||
if (!$key instanceof PrivateKey) {
|
if (!$key instanceof PrivateKey) {
|
||||||
|
@ -64,9 +64,8 @@ abstract class MSBLOB
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
@ -168,10 +167,8 @@ abstract class MSBLOB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = ''): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null): string
|
||||||
{
|
{
|
||||||
if (count($primes) != 2) {
|
if (count($primes) != 2) {
|
||||||
throw new \InvalidArgumentException('MSBLOB does not support multi-prime RSA keys');
|
throw new \InvalidArgumentException('MSBLOB does not support multi-prime RSA keys');
|
||||||
|
@ -39,9 +39,8 @@ abstract class OpenSSH extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
static $one;
|
static $one;
|
||||||
if (!isset($one)) {
|
if (!isset($one)) {
|
||||||
@ -109,11 +108,8 @@ abstract class OpenSSH extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$publicKey = self::savePublicKey($n, $e, ['binary' => true]);
|
$publicKey = self::savePublicKey($n, $e, ['binary' => true]);
|
||||||
$privateKey = Strings::packSSH2('si6', 'ssh-rsa', $n, $e, $d, $coefficients[2], $primes[1], $primes[2]);
|
$privateKey = Strings::packSSH2('si6', 'ssh-rsa', $n, $e, $d, $coefficients[2], $primes[1], $primes[2]);
|
||||||
|
@ -43,7 +43,7 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
* @param string|false $password
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
@ -106,7 +106,7 @@ abstract class PKCS1 extends Progenitor
|
|||||||
* @param string|false $password
|
* @param string|false $password
|
||||||
* @param array $options optional
|
* @param array $options optional
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$num_primes = count($primes);
|
$num_primes = count($primes);
|
||||||
$key = [
|
$key = [
|
||||||
|
@ -64,9 +64,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
@ -105,11 +104,8 @@ abstract class PKCS8 extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
$key = PKCS1::savePrivateKey($n, $e, $d, $primes, $exponents, $coefficients);
|
$key = PKCS1::savePrivateKey($n, $e, $d, $primes, $exponents, $coefficients);
|
||||||
$key = ASN1::extractBER($key);
|
$key = ASN1::extractBER($key);
|
||||||
|
@ -94,9 +94,8 @@ abstract class PSS extends Progenitor
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
@ -154,11 +153,8 @@ abstract class PSS extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
self::initialize_static_variables();
|
self::initialize_static_variables();
|
||||||
|
|
||||||
|
@ -86,11 +86,8 @@ abstract class PuTTY extends Progenitor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
if (count($primes) != 2) {
|
if (count($primes) != 2) {
|
||||||
throw new \InvalidArgumentException('PuTTY does not support multi-prime RSA keys');
|
throw new \InvalidArgumentException('PuTTY does not support multi-prime RSA keys');
|
||||||
|
@ -39,9 +39,8 @@ abstract class Raw
|
|||||||
* Break a public or private key down into its constituent components
|
* Break a public or private key down into its constituent components
|
||||||
*
|
*
|
||||||
* @param string|array $key
|
* @param string|array $key
|
||||||
* @param string|false $password
|
|
||||||
*/
|
*/
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!is_array($key)) {
|
if (!is_array($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a array - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a array - not a ' . gettype($key));
|
||||||
@ -139,11 +138,8 @@ abstract class Raw
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a private key to the appropriate format.
|
* Convert a private key to the appropriate format.
|
||||||
*
|
|
||||||
* @param string|false $password optional
|
|
||||||
* @param array $options optional
|
|
||||||
*/
|
*/
|
||||||
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, $password = '', array $options = []): string
|
public static function savePrivateKey(BigInteger $n, BigInteger $e, BigInteger $d, array $primes, array $exponents, array $coefficients, ?string $password = null, array $options = []): string
|
||||||
{
|
{
|
||||||
if (!empty($password) && is_string($password)) {
|
if (!empty($password) && is_string($password)) {
|
||||||
throw new UnsupportedFormatException('Raw private keys do not support encryption');
|
throw new UnsupportedFormatException('Raw private keys do not support encryption');
|
||||||
|
@ -298,10 +298,9 @@ class Identity implements PrivateKey
|
|||||||
/**
|
/**
|
||||||
* Sets the password
|
* Sets the password
|
||||||
*
|
*
|
||||||
* @param string|bool $password
|
|
||||||
* @return never
|
* @return never
|
||||||
*/
|
*/
|
||||||
public function withPassword($password = false)
|
public function withPassword(?string $password = null): PrivateKey
|
||||||
{
|
{
|
||||||
throw new \RuntimeException('ssh-agent does not provide a mechanism to get the private key');
|
throw new \RuntimeException('ssh-agent does not provide a mechanism to get the private key');
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ use phpseclib3\Crypt\EC\Curves\Ed448;
|
|||||||
|
|
||||||
class Ed448PrivateKey
|
class Ed448PrivateKey
|
||||||
{
|
{
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
|
@ -12,7 +12,7 @@ class Ed448PublicKey
|
|||||||
{
|
{
|
||||||
use Common;
|
use Common;
|
||||||
|
|
||||||
public static function load($key, $password = ''): array
|
public static function load($key, ?string $password = null): array
|
||||||
{
|
{
|
||||||
if (!Strings::is_stringable($key)) {
|
if (!Strings::is_stringable($key)) {
|
||||||
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
|
||||||
|
@ -431,7 +431,7 @@ qMnD/pkHR/NFcYSYShUJS0cHyryVl7/eCclsQlZTRdnVTtKF9xPGTQC8fK0G7BDN
|
|||||||
Z2sKniRCcDT1ZP4=
|
Z2sKniRCcDT1ZP4=
|
||||||
-----END PRIVATE KEY-----';
|
-----END PRIVATE KEY-----';
|
||||||
|
|
||||||
$rsa = RSA::load($key, false, 'PKCS8');
|
$rsa = RSA::load($key);
|
||||||
|
|
||||||
$this->assertInstanceOf(PrivateKey::class, $rsa);
|
$this->assertInstanceOf(PrivateKey::class, $rsa);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user