PHP 클래스 ParagonIE\Halite\Asymmetric\Crypto

파일 보기 프로젝트 열기: paragonie/halite 1 사용 예제들

공개 메소드들

메소드 설명
decrypt ( string $ciphertext, EncryptionSecretKey $ourPrivateKey, EncryptionPublicKey $theirPublicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : HiddenString Decrypt a string using asymmetric cryptography Wraps SymmetricCrypto::decrypt()
encrypt ( HiddenString $plaintext, EncryptionSecretKey $ourPrivateKey, EncryptionPublicKey $theirPublicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string Encrypt a string using asymmetric cryptography Wraps SymmetricCrypto::encrypt()
getSharedSecret ( EncryptionSecretKey $privateKey, EncryptionPublicKey $publicKey, boolean $get_as_object = false ) : HiddenString | Key Diffie-Hellman, ECDHE, etc.
seal ( HiddenString $plaintext, EncryptionPublicKey $publicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string Encrypt a message with a target users' public key
sign ( string $message, SignatureSecretKey $privateKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string Sign a message with our private key
unseal ( string $ciphertext, EncryptionSecretKey $privateKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : HiddenString Decrypt a sealed message with our private key
verify ( string $message, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean Verify a signed message with the correct public key

비공개 메소드들

메소드 설명
__construct ( ) Don't allow this to be instantiated.

메소드 상세

decrypt() 공개 정적인 메소드

Decrypt a string using asymmetric cryptography Wraps SymmetricCrypto::decrypt()
public static decrypt ( string $ciphertext, EncryptionSecretKey $ourPrivateKey, EncryptionPublicKey $theirPublicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : HiddenString
$ciphertext string The message to decrypt
$ourPrivateKey EncryptionSecretKey Our private key
$theirPublicKey EncryptionPublicKey Their public key
$encoding mixed Which encoding scheme to use?
리턴 HiddenString The decrypted message

encrypt() 공개 정적인 메소드

Encrypt a string using asymmetric cryptography Wraps SymmetricCrypto::encrypt()
public static encrypt ( HiddenString $plaintext, EncryptionSecretKey $ourPrivateKey, EncryptionPublicKey $theirPublicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string
$plaintext HiddenString The message to encrypt
$ourPrivateKey EncryptionSecretKey Our private key
$theirPublicKey EncryptionPublicKey Their public key
$encoding mixed Which encoding scheme to use?
리턴 string Ciphertext

getSharedSecret() 공개 정적인 메소드

Get a shared secret from a private key you possess and a public key for the intended message recipient
public static getSharedSecret ( EncryptionSecretKey $privateKey, EncryptionPublicKey $publicKey, boolean $get_as_object = false ) : HiddenString | Key
$privateKey EncryptionSecretKey
$publicKey EncryptionPublicKey
$get_as_object boolean Get as a Key object?
리턴 HiddenString | Key

seal() 공개 정적인 메소드

Encrypt a message with a target users' public key
public static seal ( HiddenString $plaintext, EncryptionPublicKey $publicKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string
$plaintext HiddenString Message to encrypt
$publicKey EncryptionPublicKey Public encryption key
$encoding mixed Which encoding scheme to use?
리턴 string Ciphertext

sign() 공개 정적인 메소드

Sign a message with our private key
public static sign ( string $message, SignatureSecretKey $privateKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string
$message string Message to sign
$privateKey SignatureSecretKey
$encoding mixed Which encoding scheme to use?
리턴 string Signature (detached)

unseal() 공개 정적인 메소드

Decrypt a sealed message with our private key
public static unseal ( string $ciphertext, EncryptionSecretKey $privateKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : HiddenString
$ciphertext string Encrypted message
$privateKey EncryptionSecretKey
$encoding mixed Which encoding scheme to use?
리턴 HiddenString

verify() 공개 정적인 메소드

Verify a signed message with the correct public key
public static verify ( string $message, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean
$message string Message to verify
$publicKey SignaturePublicKey
$signature string
$encoding mixed Which encoding scheme to use?
리턴 boolean