PHP 인터페이스 Neos\Flow\Security\Cryptography\RsaWalletServiceInterface

파일 보기 프로젝트 열기: neos/flow-development-collection

공개 메소드들

메소드 설명
checkRSAEncryptedPassword ( string $encryptedPassword, string $passwordHash, string $salt, string $fingerprint ) : boolean Checks if the given encrypted password is correct by comparing it's md5 hash. The salt is appended to the decrypted password string before hashing.
decrypt ( string $cypher, string $fingerprint ) : string Decrypts the given cypher with the private key identified by the given fingerprint Note: You should never decrypt a password with this function. Use checkRSAEncryptedPassword() to check passwords!
destroyKeypair ( string $fingerprint ) : void Destroys the keypair identified by the given fingerprint
encryptWithPublicKey ( string $plaintext, string $fingerprint ) : string Encrypts the given plaintext with the public key identified by the given fingerprint
generateNewKeypair ( boolean $usedForPasswords = false ) : string Generates a new keypair and returns a fingerprint to refer to it
getPublicKey ( string $fingerprint ) : OpenSslRsaKey Returns the public key for the given fingerprint
registerKeyPairFromPrivateKeyString ( string $privateKeyString, boolean $usedForPasswords = false ) : string Adds the specified keypair to the local store and returns a fingerprint to refer to it.
registerPublicKeyFromString ( string $publicKeyString ) : string Adds the specified public key to the wallet and returns a fingerprint to refer to it.
sign ( string $plaintext, string $fingerprint ) : string Signs the given plaintext with the private key identified by the given fingerprint
verifySignature ( string $plaintext, string $signature, string $fingerprint ) : boolean Checks whether the given signature is valid for the given plaintext with the public key identified by the given fingerprint

메소드 상세

checkRSAEncryptedPassword() 공개 메소드

Checks if the given encrypted password is correct by comparing it's md5 hash. The salt is appended to the decrypted password string before hashing.
public checkRSAEncryptedPassword ( string $encryptedPassword, string $passwordHash, string $salt, string $fingerprint ) : boolean
$encryptedPassword string The received, RSA encrypted password to check
$passwordHash string The md5 hashed password string (md5(md5(password) . salt))
$salt string The salt used in the md5 password hash
$fingerprint string The fingerprint to identify to correct private key
리턴 boolean TRUE if the password is correct

decrypt() 공개 메소드

Decrypts the given cypher with the private key identified by the given fingerprint Note: You should never decrypt a password with this function. Use checkRSAEncryptedPassword() to check passwords!
public decrypt ( string $cypher, string $fingerprint ) : string
$cypher string Cypher text to decrypt
$fingerprint string The fingerprint to identify to correct private key
리턴 string The decrypted text

destroyKeypair() 공개 메소드

Destroys the keypair identified by the given fingerprint
public destroyKeypair ( string $fingerprint ) : void
$fingerprint string The fingerprint
리턴 void

encryptWithPublicKey() 공개 메소드

Encrypts the given plaintext with the public key identified by the given fingerprint
public encryptWithPublicKey ( string $plaintext, string $fingerprint ) : string
$plaintext string The plaintext to encrypt
$fingerprint string The fingerprint to identify to correct public key
리턴 string The ciphertext

generateNewKeypair() 공개 메소드

Generates a new keypair and returns a fingerprint to refer to it
public generateNewKeypair ( boolean $usedForPasswords = false ) : string
$usedForPasswords boolean TRUE if this keypair should be used to encrypt passwords (then decryption won't be allowed!).
리턴 string An fingerprint that identifies the generated keypair

getPublicKey() 공개 메소드

Returns the public key for the given fingerprint
public getPublicKey ( string $fingerprint ) : OpenSslRsaKey
$fingerprint string The fingerprint
리턴 OpenSslRsaKey The public key

registerKeyPairFromPrivateKeyString() 공개 메소드

Adds the specified keypair to the local store and returns a fingerprint to refer to it.
public registerKeyPairFromPrivateKeyString ( string $privateKeyString, boolean $usedForPasswords = false ) : string
$privateKeyString string The private key in its string representation
$usedForPasswords boolean TRUE if this keypair should be used to encrypt passwords (then decryption won't be allowed!).
리턴 string The fingerprint used for storing

registerPublicKeyFromString() 공개 메소드

This is helpful if you have not private key and want to use this key only to verify incoming data.
public registerPublicKeyFromString ( string $publicKeyString ) : string
$publicKeyString string The public key in its string representation
리턴 string The fingerprint used for storing

sign() 공개 메소드

Signs the given plaintext with the private key identified by the given fingerprint
public sign ( string $plaintext, string $fingerprint ) : string
$plaintext string The plaintext to sign
$fingerprint string The fingerprint to identify to correct private key
리턴 string The signature of the given plaintext

verifySignature() 공개 메소드

Checks whether the given signature is valid for the given plaintext with the public key identified by the given fingerprint
public verifySignature ( string $plaintext, string $signature, string $fingerprint ) : boolean
$plaintext string The plaintext to sign
$signature string The signature that should be verified
$fingerprint string The fingerprint to identify to correct public key
리턴 boolean TRUE if the signature is correct for the given plaintext and public key