ParagonIE\Halite\KeyFactory::loadSignatureSecretKey PHP Метод

loadSignatureSecretKey() публичный статический Метод

Load, specifically, a signature secret key from a file
public static loadSignatureSecretKey ( string $filePath ) : SignatureSecretKey
$filePath string
Результат SignatureSecretKey
    public static function loadSignatureSecretKey(string $filePath) : SignatureSecretKey
    {
        if (!\is_readable($filePath)) {
            throw new Alerts\CannotPerformOperation('Cannot read keyfile: ' . $filePath);
        }
        return new SignatureSecretKey(self::loadKeyFile($filePath));
    }

Usage Example

Пример #1
0
             $keys[$index] = KeyFactory::loadAuthenticationKey($path);
             break;
         case 'EncryptionKey':
             $keys[$index] = KeyFactory::loadEncryptionKey($path);
             break;
         case 'EncryptionPublicKey':
             $keys[$index] = KeyFactory::loadEncryptionPublicKey($path);
             break;
         case 'EncryptionSecretKey':
             $keys[$index] = KeyFactory::loadEncryptionSecretKey($path);
             break;
         case 'SignaturePublicKey':
             $keys[$index] = KeyFactory::loadSignaturePublicKey($path);
             break;
         case 'SignatureSecretKey':
             $keys[$index] = KeyFactory::loadSignatureSecretKey($path);
             break;
         case 'EncryptionKeyPair':
             $keys[$index] = KeyFactory::loadEncryptionKeyPair($path);
             break;
         case 'SignatureKeyPair':
             $keys[$index] = KeyFactory::loadSignatureKeyPair($path);
             break;
         default:
             throw new \Error(\trk('errors.crypto.unknown_key_type', $keyConfig['type']));
     }
 } else {
     // We must generate this key/keypair at once:
     switch ($keyConfig['type']) {
         case 'EncryptionPublicKey':
         case 'SignaturePublicKey':