PHP 클래스 ParagonIE\Halite\KeyFactory

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

공개 메소드들

메소드 설명
deriveAuthenticationKey ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : AuthenticationKey Derive an authentication key (symmetric) from a password and salt
deriveEncryptionKey ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : EncryptionKey Derive an encryption key (symmetric-key cryptography) from a password and salt
deriveEncryptionKeyPair ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : EncryptionKeyPair Derive a key pair for public key encryption from a password and salt
deriveSignatureKeyPair ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : SignatureKeyPair Derive a key pair for public key signatures from a password and salt
export ( $key ) : HiddenString Export a cryptography key to a string (with a checksum)
generateAuthenticationKey ( string &$secretKey = '' ) : AuthenticationKey Generate an an authentication key (symmetric-key cryptography)
generateEncryptionKey ( string &$secretKey = '' ) : EncryptionKey Generate an an encryption key (symmetric-key cryptography)
generateEncryptionKeyPair ( string &$secretKey = '' ) : EncryptionKeyPair Generate a key pair for public key encryption
generateSignatureKeyPair ( string &$secretKey = '' ) : SignatureKeyPair Generate a key pair for public key digital signatures
getKeyDataFromString ( string $data ) : string Take a stored key string, get the derived key (after verifying the checksum)
getSecurityLevels ( string $level = self::INTERACTIVE ) : array Returns a 2D array [OPSLIMIT, MEMLIMIT] for the appropriate security level.
importAuthenticationKey ( HiddenString $keyData ) : AuthenticationKey Load a symmetric authentication key from a string
importEncryptionKey ( HiddenString $keyData ) : EncryptionKey Load a symmetric encryption key from a string
importEncryptionKeyPair ( HiddenString $keyData ) : EncryptionKeyPair Load an asymmetric encryption key pair from a string
importEncryptionPublicKey ( HiddenString $keyData ) : EncryptionPublicKey Load, specifically, an encryption public key from a string
importEncryptionSecretKey ( HiddenString $keyData ) : EncryptionSecretKey Load, specifically, an encryption secret key from a string
importSignatureKeyPair ( HiddenString $keyData ) : SignatureKeyPair Load an asymmetric signature key pair from a string
importSignaturePublicKey ( HiddenString $keyData ) : SignaturePublicKey Load, specifically, a signature public key from a string
importSignatureSecretKey ( HiddenString $keyData ) : SignatureSecretKey Load, specifically, a signature secret key from a string
loadAuthenticationKey ( string $filePath ) : AuthenticationKey Load a symmetric authentication key from a file
loadEncryptionKey ( string $filePath ) : EncryptionKey Load a symmetric encryption key from a file
loadEncryptionKeyPair ( string $filePath ) : EncryptionKeyPair Load an asymmetric encryption key pair from a file
loadEncryptionPublicKey ( string $filePath ) : EncryptionPublicKey Load, specifically, an encryption public key from a file
loadEncryptionSecretKey ( string $filePath ) : EncryptionSecretKey Load, specifically, an encryption public key from a file
loadSignatureKeyPair ( string $filePath ) : SignatureKeyPair Load an asymmetric signature key pair from a file
loadSignaturePublicKey ( string $filePath ) : SignaturePublicKey Load, specifically, a signature public key from a file
loadSignatureSecretKey ( string $filePath ) : SignatureSecretKey Load, specifically, a signature secret key from a file
save ( Key | KeyPair $key, string $filename = '' ) : boolean Save a key to a file

보호된 메소드들

메소드 설명
loadKeyFile ( string $filePath ) : HiddenString Read a key from a file, verify its checksum
saveKeyFile ( string $filePath, string $keyData ) : boolean Save a key to a file

메소드 상세

deriveAuthenticationKey() 공개 정적인 메소드

Derive an authentication key (symmetric) from a password and salt
public static deriveAuthenticationKey ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : AuthenticationKey
$password HiddenString
$salt string
$level string Security level for KDF
리턴 AuthenticationKey

deriveEncryptionKey() 공개 정적인 메소드

Derive an encryption key (symmetric-key cryptography) from a password and salt
public static deriveEncryptionKey ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : EncryptionKey
$password HiddenString
$salt string
$level string Security level for KDF
리턴 EncryptionKey

deriveEncryptionKeyPair() 공개 정적인 메소드

Derive a key pair for public key encryption from a password and salt
public static deriveEncryptionKeyPair ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : EncryptionKeyPair
$password HiddenString
$salt string
$level string Security level for KDF
리턴 EncryptionKeyPair

deriveSignatureKeyPair() 공개 정적인 메소드

Derive a key pair for public key signatures from a password and salt
public static deriveSignatureKeyPair ( HiddenString $password, string $salt, string $level = self::INTERACTIVE ) : SignatureKeyPair
$password HiddenString
$salt string
$level string Security level for KDF
리턴 SignatureKeyPair

export() 공개 정적인 메소드

Export a cryptography key to a string (with a checksum)
public static export ( $key ) : HiddenString
$key
리턴 HiddenString

generateAuthenticationKey() 공개 정적인 메소드

Generate an an authentication key (symmetric-key cryptography)
public static generateAuthenticationKey ( string &$secretKey = '' ) : AuthenticationKey
$secretKey string
리턴 AuthenticationKey

generateEncryptionKey() 공개 정적인 메소드

Generate an an encryption key (symmetric-key cryptography)
public static generateEncryptionKey ( string &$secretKey = '' ) : EncryptionKey
$secretKey string
리턴 EncryptionKey

generateEncryptionKeyPair() 공개 정적인 메소드

Generate a key pair for public key encryption
public static generateEncryptionKeyPair ( string &$secretKey = '' ) : EncryptionKeyPair
$secretKey string
리턴 EncryptionKeyPair

generateSignatureKeyPair() 공개 정적인 메소드

Generate a key pair for public key digital signatures
public static generateSignatureKeyPair ( string &$secretKey = '' ) : SignatureKeyPair
$secretKey string
리턴 SignatureKeyPair

getKeyDataFromString() 공개 정적인 메소드

Take a stored key string, get the derived key (after verifying the checksum)
public static getKeyDataFromString ( string $data ) : string
$data string
리턴 string

getSecurityLevels() 공개 정적인 메소드

Returns a 2D array [OPSLIMIT, MEMLIMIT] for the appropriate security level.
public static getSecurityLevels ( string $level = self::INTERACTIVE ) : array
$level string
리턴 array

importAuthenticationKey() 공개 정적인 메소드

Load a symmetric authentication key from a string
public static importAuthenticationKey ( HiddenString $keyData ) : AuthenticationKey
$keyData HiddenString
리턴 AuthenticationKey

importEncryptionKey() 공개 정적인 메소드

Load a symmetric encryption key from a string
public static importEncryptionKey ( HiddenString $keyData ) : EncryptionKey
$keyData HiddenString
리턴 EncryptionKey

importEncryptionKeyPair() 공개 정적인 메소드

Load an asymmetric encryption key pair from a string
public static importEncryptionKeyPair ( HiddenString $keyData ) : EncryptionKeyPair
$keyData HiddenString
리턴 EncryptionKeyPair

importEncryptionPublicKey() 공개 정적인 메소드

Load, specifically, an encryption public key from a string
public static importEncryptionPublicKey ( HiddenString $keyData ) : EncryptionPublicKey
$keyData HiddenString
리턴 EncryptionPublicKey

importEncryptionSecretKey() 공개 정적인 메소드

Load, specifically, an encryption secret key from a string
public static importEncryptionSecretKey ( HiddenString $keyData ) : EncryptionSecretKey
$keyData HiddenString
리턴 EncryptionSecretKey

importSignatureKeyPair() 공개 정적인 메소드

Load an asymmetric signature key pair from a string
public static importSignatureKeyPair ( HiddenString $keyData ) : SignatureKeyPair
$keyData HiddenString
리턴 SignatureKeyPair

importSignaturePublicKey() 공개 정적인 메소드

Load, specifically, a signature public key from a string
public static importSignaturePublicKey ( HiddenString $keyData ) : SignaturePublicKey
$keyData HiddenString
리턴 SignaturePublicKey

importSignatureSecretKey() 공개 정적인 메소드

Load, specifically, a signature secret key from a string
public static importSignatureSecretKey ( HiddenString $keyData ) : SignatureSecretKey
$keyData HiddenString
리턴 SignatureSecretKey

loadAuthenticationKey() 공개 정적인 메소드

Load a symmetric authentication key from a file
public static loadAuthenticationKey ( string $filePath ) : AuthenticationKey
$filePath string
리턴 AuthenticationKey

loadEncryptionKey() 공개 정적인 메소드

Load a symmetric encryption key from a file
public static loadEncryptionKey ( string $filePath ) : EncryptionKey
$filePath string
리턴 EncryptionKey

loadEncryptionKeyPair() 공개 정적인 메소드

Load an asymmetric encryption key pair from a file
public static loadEncryptionKeyPair ( string $filePath ) : EncryptionKeyPair
$filePath string
리턴 EncryptionKeyPair

loadEncryptionPublicKey() 공개 정적인 메소드

Load, specifically, an encryption public key from a file
public static loadEncryptionPublicKey ( string $filePath ) : EncryptionPublicKey
$filePath string
리턴 EncryptionPublicKey

loadEncryptionSecretKey() 공개 정적인 메소드

Load, specifically, an encryption public key from a file
public static loadEncryptionSecretKey ( string $filePath ) : EncryptionSecretKey
$filePath string
리턴 EncryptionSecretKey

loadKeyFile() 보호된 정적인 메소드

Read a key from a file, verify its checksum
protected static loadKeyFile ( string $filePath ) : HiddenString
$filePath string
리턴 HiddenString

loadSignatureKeyPair() 공개 정적인 메소드

Load an asymmetric signature key pair from a file
public static loadSignatureKeyPair ( string $filePath ) : SignatureKeyPair
$filePath string
리턴 SignatureKeyPair

loadSignaturePublicKey() 공개 정적인 메소드

Load, specifically, a signature public key from a file
public static loadSignaturePublicKey ( string $filePath ) : SignaturePublicKey
$filePath string
리턴 SignaturePublicKey

loadSignatureSecretKey() 공개 정적인 메소드

Load, specifically, a signature secret key from a file
public static loadSignatureSecretKey ( string $filePath ) : SignatureSecretKey
$filePath string
리턴 SignatureSecretKey

save() 공개 정적인 메소드

Save a key to a file
public static save ( Key | KeyPair $key, string $filename = '' ) : boolean
$key Key | KeyPair
$filename string
리턴 boolean

saveKeyFile() 보호된 정적인 메소드

Save a key to a file
protected static saveKeyFile ( string $filePath, string $keyData ) : boolean
$filePath string
$keyData string
리턴 boolean