[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/ -> PublicKey.php (summary)

RSA Public Key

Author: Jim Wigginton <[email protected]>
Copyright: 2015 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
File Size: 527 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PublicKey:: (14 methods):
  exponentiate()
  rsavp1()
  rsassa_pkcs1_v1_5_verify()
  rsassa_pkcs1_v1_5_relaxed_verify()
  emsa_pss_verify()
  rsassa_pss_verify()
  verify()
  rsaes_pkcs1_v1_5_encrypt()
  rsaes_oaep_encrypt()
  rsaep()
  raw_encrypt()
  encrypt()
  toString()
  asPrivateKey()


Class: PublicKey  - X-Ref

Raw RSA Key Handler

exponentiate(BigInteger $x)   X-Ref
Exponentiate

param: \phpseclib3\Math\BigInteger $x
return: \phpseclib3\Math\BigInteger

rsavp1($s)   X-Ref
RSAVP1

See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}.

param: \phpseclib3\Math\BigInteger $s
return: bool|\phpseclib3\Math\BigInteger

rsassa_pkcs1_v1_5_verify($m, $s)   X-Ref
RSASSA-PKCS1-V1_5-VERIFY

See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}.

param: string $m
param: string $s
return: bool

rsassa_pkcs1_v1_5_relaxed_verify($m, $s)   X-Ref
RSASSA-PKCS1-V1_5-VERIFY (relaxed matching)

Per {@link http://tools.ietf.org/html/rfc3447#page-43 RFC3447#page-43} PKCS1 v1.5
specified the use BER encoding rather than DER encoding that PKCS1 v2.0 specified.
This means that under rare conditions you can have a perfectly valid v1.5 signature
that fails to validate with _rsassa_pkcs1_v1_5_verify(). PKCS1 v2.1 also recommends
that if you're going to validate these types of signatures you "should indicate
whether the underlying BER encoding is a DER encoding and hence whether the signature
is valid with respect to the specification given in [PKCS1 v2.0+]". so if you do
$rsa->getLastPadding() and get RSA::PADDING_RELAXED_PKCS1 back instead of
RSA::PADDING_PKCS1... that means BER encoding was used.

param: string $m
param: string $s
return: bool

emsa_pss_verify($m, $em, $emBits)   X-Ref
EMSA-PSS-VERIFY

See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}.

param: string $m
param: string $em
param: int $emBits
return: string

rsassa_pss_verify($m, $s)   X-Ref
RSASSA-PSS-VERIFY

See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}.

param: string $m
param: string $s
return: bool|string

verify($message, $signature)   X-Ref
Verifies a signature

param: string $message
param: string $signature
return: bool

rsaes_pkcs1_v1_5_encrypt($m, $pkcs15_compat = false)   X-Ref
RSAES-PKCS1-V1_5-ENCRYPT

See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}.

param: string $m
param: bool $pkcs15_compat optional
return: bool|string

rsaes_oaep_encrypt($m)   X-Ref
RSAES-OAEP-ENCRYPT

See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and
{http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}.

param: string $m
return: string

rsaep($m)   X-Ref
RSAEP

See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}.

param: \phpseclib3\Math\BigInteger $m
return: bool|\phpseclib3\Math\BigInteger

raw_encrypt($m)   X-Ref
Raw Encryption / Decryption

Doesn't use padding and is not recommended.

param: string $m
return: bool|string

encrypt($plaintext)   X-Ref
Encryption

Both self::PADDING_OAEP and self::PADDING_PKCS1 both place limits on how long $plaintext can be.
If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will
be concatenated together.

param: string $plaintext
return: bool|string

toString($type, array $options = [])   X-Ref
Returns the public key

The public key is only returned under two circumstances - if the private key had the public key embedded within it
or if the public key was set via setPublicKey().  If the currently loaded key is supposed to be the public key this
function won't return it since this library, for the most part, doesn't distinguish between public and private keys.

param: string $type
param: array $options optional
return: mixed

asPrivateKey()   X-Ref
Converts a public key to a private key

return: RSA



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer